开发者

How to avoid indenting comment blocks with vim cindent?

I have a comment block such as:

/*++
 Blah:
   blah
 Foo:
   foo
 --*/

And I'm using the following vim cindent options:

set shiftwidth=2
set tabstop=2
set cindent
set cino=g0,+0,(0,W2

If I select that comment block and indent it with =,开发者_Go百科 vim turns it into:

/*++
  Blah:
  blah
Foo:
foo
--*/

Can I tell vim cindent not to indent comment blocks?


No, I don't think that's possible.

If indent of comments is important to you, I would consider switching the comment style (with mb:* in 'comments') to this:

/*
 * Blah:
 *   blah
 * Foo:
 *   foo
 */
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜