caio.co/de/dotfiles

rip treesitter, more predictable fold behaviour

Id
2a6c847768f1734880b806d3ddafa9329a6ed4c7
Author
Caio
Commit time
2025-04-08T18:48:35+01:00

Modified config/nvim/ftplugin/go.vim

@@ -1,6 +1,1
setlocal noexpandtab shiftwidth=4 softtabstop=4 tabstop=4 nolist
-
-" if has_treesitter
-setlocal nofoldenable
-setlocal foldmethod=expr
-setlocal foldexpr=nvim_treesitter#foldmethod()

Modified config/nvim/lua/config/lsp.lua

@@ -28,6 +28,7
end

if client:supports_method('textDocument/foldingRange') then
+ vim.o.foldlevel = 99
vim.o.foldmethod = "expr"
vim.o.foldexpr = "v:lua.vim.lsp.foldexpr()"
end

Deleted config/nvim/ftplugin/rust.vim

@@ -1,4 +1,0
-" fold via treesitter but start with everthing expanded
-setlocal nofoldenable
-setlocal foldmethod=expr
-setlocal foldexpr=nvim_treesitter#foldexpr()