Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for the correct cinoptions for this piece of code

What cinoptions can I set for getting the block below indented as shown?

f(int *p) 
: a(p)
, b(0)
{
  std::cerr << blah
    << foo << std::endl;
}

The closest I've got was to:

f(int* p) 
  : a(p)
  , b(0)
  {
    std::cerr << blah
      << foo << std::endl;
  }

That's almost what I want, only that everything after : is indented :)
For that, I used: set cino=i0,+2

like image 563
rturrado Avatar asked Mar 24 '11 19:03

rturrado


1 Answers

How about i0,+2,t0? (tN is for "a function return type declaration").

That worked for me, but, the vims I tried (7.0 and 7.3) did two different things, neither the same as yours, with i0,+2.

like image 143
Andy Avatar answered Sep 27 '22 02:09

Andy