有没有像Visual Studio或Eclipse这样的方法或工具来折叠vim中的功能?
发布于 2010-03-02 20:07:34
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 docs。
发布于 2013-05-25 04:36:56
是。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把他们都赶走。
发布于 2010-03-02 20:11:14
:set foldmethod=syntax应该自动折叠所有函数和其他块,如果你有你的语言的语法文件。
https://stackoverflow.com/questions/2362914
复制相似问题