On 09/04/2014 05:22 PM, Richard Biener wrote:
For some reason I use
set shiftwidth=4
set tabstop=8
set autoindent
set cinoptions={.5s,g0,p5,t0,(0,^-0.5s,n-0.5s
I note some differences to your
+ setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1
Ah, the vimfu.
So the differences seem to boil down to
1) your config uses autoindent (mine does cindent)
2) my (well, Laurynas's) cinoptions additionally include
>4,:2,=2,h2,+2,u0,w1,m1
3) your config sets tabstop whereas mine uses softtabstop
4) formatoptions cause autowrapping of comments at 80-th column
I'm not sure about 1), but 2) allows:
* case labels start under parent {
* correct indent on line break (should be 2, not 4)
which seem to match current GCC style.
Also due to 3) issuing a tab expands to 2 spaces
instead of real tab which is probably a Good Thing.
Your settings beat mine at m1 though - it should be removed
to allow vim to match closing ) with opening.
So I'd say that in general proposed patch handles more cases (with
removed m1).
-Y