假设我有这样一个注释块:
/**
* comment
* comment
* comment
*/
当我在这个块内打开新行时,我希望vim以
开头。/**
* comment
* _
* comment
* comment
*/
但是在标准(Ubuntu)vim脚本中的自动缩进会开始一个空行,例如:
/**
* comment
_
* comment
* comment
*/
有没有可以让Vim实现这个功能的修改脚本或命令呢?(我记得几年前我就有这种功能,但现在无法通过谷歌搜索找到它了)。谢谢。
set nocp
来设置非Vi兼容模式,否则formatoptions将不起作用。 - richq