如果* /不存在,VIM C / *评论*在新行上

时间:2014-01-19 01:19:30

标签: c vim

很久以前我在VIM上编写C代码的时候在另一台机器上启用了一些功能,这样当我用/*开始评论并在键入*/之前按Enter键时, VIM会放一个*并将它放得很好。那是什么,我该怎么回来?我希望它能自动执行此操作:

/* some comments
 * <-- VIM put this " * " here */

一般建议让VIM受到欢迎。

1 个答案:

答案 0 :(得分:5)

r中的oformatoptions。见:help fo-table

letter  meaning when present in 'formatoptions'

r       Automatically insert the current comment leader after hitting           
        <Enter> in Insert mode.                                                 
o       Automatically insert the current comment leader after hitting 'o' or    
        'O' in Normal mode.
相关问题