From 5502d29f408509838afab2b0e6e5ef6b1614f543 Mon Sep 17 00:00:00 2001 From: jdhao Date: Mon, 5 Aug 2024 23:14:24 +0200 Subject: [PATCH] update config related to folding 1. For python and lua, rely on LSP for folding 2. show fold signs on the right of the number column --- after/ftplugin/lua.vim | 4 ---- after/ftplugin/python.vim | 4 ---- lua/plugin_specs.lua | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/after/ftplugin/lua.vim b/after/ftplugin/lua.vim index 910c31d..914dd84 100644 --- a/after/ftplugin/lua.vim +++ b/after/ftplugin/lua.vim @@ -3,7 +3,3 @@ set formatoptions-=o set formatoptions-=r nnoremap :luafile % - -" 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 a9f625c..7e8b33b 100644 --- a/after/ftplugin/python.vim +++ b/after/ftplugin/python.vim @@ -12,7 +12,3 @@ set tabstop=4 " number of visual spaces per TAB set softtabstop=4 " number of spaces in tab when editing set shiftwidth=4 " number of spaces to use for autoindent set expandtab " expand tab to spaces so that tabs are spaces - -" Use nvim-treesitter for folding -set foldmethod=expr -set foldexpr=nvim_treesitter#foldexpr() diff --git a/lua/plugin_specs.lua b/lua/plugin_specs.lua index f040f23..008c11f 100644 --- a/lua/plugin_specs.lua +++ b/lua/plugin_specs.lua @@ -194,9 +194,9 @@ local plugin_specs = { require("statuscol").setup { relculright = true, segments = { - { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, { text = { "%s" }, click = "v:lua.ScSa" }, { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, + { text = { builtin.foldfunc, " " }, condition = {true, builtin.not_empty}, click = "v:lua.ScFa" }, }, } end,