commit 2950ef622224df134e53a26e6f27bf5dfe4d4bab parent 050f54c0d05de201d784204021476a0d971af847 Author: Alex Balgavy <alex@balgavy.eu> Date: Wed, 17 Feb 2021 18:09:34 +0100 vim: fix pragma indentation in C Diffstat:
A | vim/after/indent/c.vim | | | 36 | ++++++++++++++++++++++++++++++++++++ |
1 file changed, 36 insertions(+), 0 deletions(-)
diff --git a/vim/after/indent/c.vim b/vim/after/indent/c.vim @@ -0,0 +1,36 @@ +setlocal cinoptions=>s " add 'shiftwidth' for normal indent +setlocal cinoptions=e0 " add 0 to block indent when opening brace is at end of line +setlocal cinoptions+=n0 " add 0 to indent after if/while if not inside braces +setlocal cinoptions+=f0 " indent first opening brace of block to column 0 +setlocal cinoptions+={0 " indent opening braces by 0 +setlocal cinoptions+=}0 " indent closing braces by 0 +setlocal cinoptions+=^0 " add 0 to indent in braces if opening brace is in column 0 +setlocal cinoptions+=L-1 " place jump label in column 1 +setlocal cinoptions+=:s " place case labels 'shiftwidth' from indent of switch +setlocal cinoptions+==s " indent statements after case label by 'shiftwidth' +setlocal cinoptions+=l0 +setlocal cinoptions+=b0 +setlocal cinoptions+=gs +setlocal cinoptions+=hs +setlocal cinoptions+=N0 +setlocal cinoptions+=E0 +setlocal cinoptions+=ps +setlocal cinoptions+=ts +setlocal cinoptions+=is +setlocal cinoptions+=+s +setlocal cinoptions+=c3 +setlocal cinoptions+=C0 +setlocal cinoptions+=/0 +setlocal cinoptions+=(2s +setlocal cinoptions+=us +setlocal cinoptions+=U0 +setlocal cinoptions+=w0 +setlocal cinoptions+=W0 +setlocal cinoptions+=k0 +setlocal cinoptions+=m0 +setlocal cinoptions+=j0 +setlocal cinoptions+=J0 +setlocal cinoptions+=)20 +setlocal cinoptions+=*70 +setlocal cinoptions+=#0 +setlocal cinoptions+=P1 " recognize pragmas and indent them like any other code