Vim python模式折叠



我最近下载了Python-Mode。当我打开一个python脚本时,我的函数被折叠。我可以很容易地展开(当您在函数定义顶部时,它是移动键之一)。但是,我不知道如何重新折叠这个功能。

此外,也许最重要的是,:help pymode返回一个错误('E149: Sorry, no help for pymode')。所以我甚至不能查找文档。

下面是一个折叠命令列表:

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.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zc close a fold at the 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.

您要找的是zc

按下zc关闭vim中的折叠。关闭所有折叠:zM。这些都在Vim文档中。

set foldclose=all在你的vimrc将解决它。更多细节见:h fcl

当光标不在折线中时,此选项会自动折叠。因此,不需要通过手动输入zc等命令来重新折叠。

你可以在help fold-commands找到折叠相关的命令列表,如果你不想要foldclose选项

最新更新