我在vim中启用了折叠,这里是.vimrc snipet。
set foldmethod=syntax
set foldnestmax=1
set foldlevel=0
set foldclose=all
它工作正常,但是当我向下滚动一个c函数时它会自动折叠,有关如何打开折叠的任何想法吗?
答案 0 :(得分:2)
Vim正在按照你所指示的去做;特别是您选择的'foldclose'
和'foldlevel'
的组合。来自:help 'foldclose'
:
'foldclose' 'fcl' string (default "")
When set to "all", a fold is closed when the cursor isn't in it and
its level is higher than 'foldlevel'. Useful if you want folds to
automatically close when moving out of them.
如果你不喜欢这种行为,只需放弃set foldclose=all
。