题
有什么方法或工具能够折叠的vim的功能,如Visual Studio或者Eclipse?
解决方案
Vim folding commands
---------------------------------
zf#j creates a fold from the cursor down # lines.
zf/ string creates a fold from the cursor to string .
zj moves the cursor to the next fold.
zk moves the cursor to the previous fold.
za toggle a fold at the cursor.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zc closes a fold under cursor.
zm increases the foldlevel by one.
zM closes all open folds.
zr decreases the foldlevel by one.
zR decreases the foldlevel to zero -- all folds will be open.
zd deletes the fold at the cursor.
zE deletes all folds.
[z move to start of open fold.
]z move to end of open fold.
来源:VIM文档
其他提示
是。 VIM具有优异的折叠功能。我不喜欢学习太多的控制,我更喜欢自动化,所以这里是我个人用什么:
在我的.vimrc:
set foldmethod=indent
set foldlevel=1
set foldclose=all
这个自动折叠文件打开,根据缩进,一切缩进超过1平。所述foldclose选项使得自动折叠重新关闭后我导航折叠的进行。
在文件控制:
zo - opens folds
zc - closes fold
zm - increases auto fold depth
zr - reduces auto fold depth
如果你曾经得到恼火的褶皱,使用
: set foldmethod=syntax
,或按:
zR
让他们都去了。
:set foldmethod=syntax
应该自动折叠所有功能和其他块,如果你有语法文件为您的语言。
Vim有优良的折叠支撑。有一个在VIM帮助系统良好的文档。只需打开VIM并做
:help usr_28.txt
读,你也可以读出后
:help folding
有关的更多信息。
是,则结合至“Z”键,例如打开的z0所有折叠。见“:帮助折叠”在vim获取更多信息。可以做折叠根据非常简单的规则,如压痕,或根据代码的语法。
不隶属于 StackOverflow