rturrado
rturrado

Reputation: 8074

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 =, vim turns it into:

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

Can I tell vim cindent not to indent comment blocks?

Upvotes: 4

Views: 301

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172768

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
 */

Upvotes: 1

Related Questions