cod*_*ict 103
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.
Run Code Online (Sandbox Code Playgroud)
资料来源:vim docs.
bhe*_*man 52
是.VIM具有出色的折叠功能.我不喜欢学习太多的控件,我更喜欢自动化,所以这是我个人使用的:
在我的.vimrc中:
set foldmethod=indent
set foldlevel=1
set foldclose=all
Run Code Online (Sandbox Code Playgroud)
这会自动折叠您打开的文件,基于缩进,对于缩进超过1级的所有内容.折叠关闭选项使折叠自动重新关闭.
文件内控件:
zo - opens folds
zc - closes fold
zm - increases auto fold depth
zr - reduces auto fold depth
Run Code Online (Sandbox Code Playgroud)
如果你对褶皱感到恼火,请使用
: set foldmethod=syntax
Run Code Online (Sandbox Code Playgroud)
或按:
zR
Run Code Online (Sandbox Code Playgroud)
让它们全部消失.
Pau*_*aul 18
:set foldmethod=syntax
Run Code Online (Sandbox Code Playgroud)
如果您的语言有语法文件,则应自动折叠所有函数和其他块.
Vim 具有出色的折叠支持。vim 帮助系统中有很好的文档。只需打开 vim 并执行以下操作
:help usr_28.txt
Run Code Online (Sandbox Code Playgroud)
读完后您还可以阅读
:help folding
Run Code Online (Sandbox Code Playgroud)
了解更多信息。
归档时间: |
|
查看次数: |
32741 次 |
最近记录: |