当我向下滚动时Vim禁用自动转换?

时间:2016-08-31 14:22:58

标签: vim folding

我在vim中启用了折叠,这里是.vimrc snipet。

set foldmethod=syntax
set foldnestmax=1
set foldlevel=0
set foldclose=all

它工作正常,但是当我向下滚动一个c函数时它会自动折叠,有关如何打开折叠的任何想法吗?

1 个答案:

答案 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