diff options
| author | jdhao <jdhao@hotmail.com> | 2021-12-14 21:48:58 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-12-14 21:48:58 +0800 |
| commit | 5215a601b9221f8b2276a9bbc7cc7f0e5f78d556 (patch) | |
| tree | f8aa044b8f898621726f3a381a80c418815db26e /after/ftplugin | |
| parent | 9bac7fa4f70497106f47db463c9d5e1ab4722404 (diff) | |
update fold conf for vim script
When setting foldlevel to 0 and load some plugin via InsertEnter event
using packer.nvim, if we press i to go to insert mode, the fold for vim
script file will be automatically closed. It is really annoying.
I have pinpoint the issue to the combination of packer.nvim and setting
foldlevel to 0 in after/ftplugin/vim.vim. What is interesting is that
default value for foldlevel is also 0. However, if we do not set it in
vim.vim, the above issue won't occur, which is strange.
Diffstat (limited to 'after/ftplugin')
| -rw-r--r-- | after/ftplugin/vim.vim | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/after/ftplugin/vim.vim b/after/ftplugin/vim.vim index d0f33b9..fba721e 100644 --- a/after/ftplugin/vim.vim +++ b/after/ftplugin/vim.vim @@ -6,8 +6,7 @@ set formatoptions-=r " modeline is annoying in that the modeline get executed each time the window " focus is lost (see " https://github.com/tmux-plugins/vim-tmux-focus-events/issues/14) -set foldmethod=expr foldlevel=0 foldlevelstart=-1 - \ foldexpr=utils#VimFolds(v:lnum) foldtext=utils#MyFoldText() +set foldmethod=expr foldexpr=utils#VimFolds(v:lnum) foldtext=utils#MyFoldText() " Use :help command for keyword when pressing `K` in vim file, " see `:h K` and https://stackoverflow.com/q/15867323/6064933 |
