Nvim: add treesitter folding

This commit is contained in:
Marko Korhonen 2022-04-22 09:50:18 +03:00
parent 9fb514c193
commit 34f9a46a50

View File

@ -4,3 +4,10 @@ require'nvim-treesitter.configs'.setup {
incremental_selection = {enable = true},
context_commentstring = {enable = true}
}
vim.wo.foldmethod = 'expr';
vim.wo.foldexpr = 'nvim_treesitter#foldexpr()'
vim.wo.foldtext = [[substitute(getline(v:foldstart), '\\t' repeat('\ ',&tabstop),'g').'...'.trim(v:foldend)]]
vim.wo.fillchars = 'fold:\\'
vim.wo.foldnestmax = 3
vim.wo.foldminlines = 1