【发布时间】:2016-08-31 14:22:57
【问题描述】:
我在 vim 中启用了折叠,这里是 .vimrc snipet。
set foldmethod=syntax
set foldnestmax=1
set foldlevel=0
set foldclose=all
它工作正常,但是当我向下滚动一个 c 函数时它会自动折叠,你知道如何让折叠保持打开状态吗?
【问题讨论】:
我在 vim 中启用了折叠,这里是 .vimrc snipet。
set foldmethod=syntax
set foldnestmax=1
set foldlevel=0
set foldclose=all
它工作正常,但是当我向下滚动一个 c 函数时它会自动折叠,你知道如何让折叠保持打开状态吗?
【问题讨论】:
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。
【讨论】: