我最近下载了Python-Mode。当我打开一个Python脚本时,我的函数被折叠起来了。我可以轻松展开(只需要在函数定义顶部按动作键之一即可)。但是,我无法弄清楚如何重新折叠函数。
此外,也许最重要的是,:help pymode
返回一个错误('E149: Sorry, no help for pymode')。所以,我甚至无法查找文档。
如果有任何帮助将不胜感激。
我最近下载了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文档中有详细说明。在你的vimrc
中设置set foldclose=all
将解决此问题。更多细节请参见:h fcl
。
当光标不在折叠区域内时,它会自动折叠。因此,不需要手动输入像zc
这样的命令进行重新折叠,这是一个优点。
如果您不想使用foldclose
选项,则可以在help fold-commands
中找到与折叠相关的命令列表。
set nofoldenable
可以确保打开文件时是“正常”的,即没有折叠。 - NeilG