为什么vim在非空白字符后无法识别注释?怎么解决这个问题?

时间:2014-06-30 15:51:48

标签: vim

vim识别开始该行的注释或仅遵循下面的空格字符。

// This is recognized as a comment by vim.
// Pressing <Enter> continues the comment on the next line.
{
  // vim will also automatically format these comments if they exceed textwidth
  // characters in length.
}

但是,当代码跟随代码时,vim似乎不会识别它,以便在以下行中添加注释引导。

DoSomething(); // vim does not recognize this as a comment
and will neither continue the comment after <Enter> is pressed nor break automatically if the line exceeds textwidth characters.

如果有帮助,我的这是〜.vimrc文件。我通常:set cindent,但似乎对评论没有影响。

set cino=L0,l1,g1,h1,N-s,t0,(0,w1,W2s
set expandtab
set formatoptions=croq
set shiftwidth=2
set tabstop=2
set textwidth=80

谢谢!

1 个答案:

答案 0 :(得分:1)

//开头的评论仅对 有效