From e462ebcbcc8bcce913135c487dd8d564206e236e Mon Sep 17 00:00:00 2001 From: jdhao Date: Tue, 7 May 2024 21:38:06 +0200 Subject: [PATCH] Enable treesitter folding for Python and Lua --- after/ftplugin/lua.vim | 4 ++++ after/ftplugin/python.vim | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/after/ftplugin/lua.vim b/after/ftplugin/lua.vim index 73b1a8f..6fdbc66 100644 --- a/after/ftplugin/lua.vim +++ b/after/ftplugin/lua.vim @@ -6,3 +6,7 @@ nnoremap :luafile % " For delimitMate let b:delimitMate_matchpairs = "(:),[:],{:}" + +" Use nvim-treesitter for folding +set foldmethod=expr +set foldexpr=nvim_treesitter#foldexpr() diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim index 185aa6e..71e31c0 100644 --- a/after/ftplugin/python.vim +++ b/after/ftplugin/python.vim @@ -15,3 +15,7 @@ set expandtab " expand tab to spaces so that tabs are spaces " For delimitMate let b:delimitMate_matchpairs = "(:),[:],{:}" + +" Use nvim-treesitter for folding +set foldmethod=expr +set foldexpr=nvim_treesitter#foldexpr()