From a1ea629d3c087152ac5252cbfbc4099b3d89bbc4 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Fri, 18 Nov 2022 21:59:33 -0500 Subject: [PATCH] change nvim fold method --- .vimrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 91e9912..b028f0b 100644 --- a/.vimrc +++ b/.vimrc @@ -168,8 +168,13 @@ " Yank from the cursor to the end of the line, to be consistent with C and D. nnoremap Y y$ - set foldmethod=syntax - autocmd FileType python set foldmethod=indent + if has('nvim') + set foldmethod=expr + set foldexpr=nvim_treesitter#foldexpr() + else + set foldmethod=syntax + autocmd FileType python set foldmethod=indent + endif "set nofoldenable " Find merge conflict markers