16

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

此外,也许最重要的是,:help pymode返回一个错误('E149:对不起,pymode 没有帮助')。所以我什至无法查看文档。

任何帮助,将不胜感激。

4

3 回答 3

35

这里是折叠命令的列表:

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.

于 2014-05-10T08:59:34.040 回答
5

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

于 2014-05-10T08:57:41.443 回答
3

set foldclose=all在你的意志中vimrc解决它。更多细节在:h fcl

当光标不在折叠中时,它会自动折叠。因此,通过手动键入命令(如zc.

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

于 2016-01-26T21:01:52.743 回答