feat(neovim): add markdown folding by heading via Treesitter 📝
This commit is contained in:
parent
be6dde6f0a
commit
72d8714e51
1 changed files with 10 additions and 0 deletions
|
|
@ -45,6 +45,16 @@
|
|||
vim.opt.spell = true
|
||||
vim.opt.spelllang = "en_us"
|
||||
|
||||
-- Markdown: fold by heading/section using Treesitter
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.foldmethod = "expr"
|
||||
vim.opt_local.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.opt_local.foldenable = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Keymaps
|
||||
vim.keymap.set("n", "S", ":%s//g<Left><Left>", { desc = "Replace all" })
|
||||
vim.keymap.set("n", "<leader>w", ":w<CR>", { desc = "Save file" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue