Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit c-support (c.vim) snippets

Tags:

c++

c

vim

I really dislike the default indentation used on return type of functions, e.g. \im (for main function has the return type indented). I would like return type not indented.

Documentation says -- I should rename the snippet $HOME\vimfiles\c-support\codesnippets\main.c to main.c.ni (or main.c.nonindent). But that did not fix the problem.

Any other ideas ?

gvim with c-support by default adds this

     int
 main ( int argc, char *argv[] )
 {

     return EXIT_SUCCESS;
 }              /* ----------  end of function main  ---------- */

instead, I would like this

 int
 main ( int argc, char *argv[] )
 {

     return EXIT_SUCCESS;
 }
like image 598
user536012 Avatar asked May 11 '26 00:05

user536012


1 Answers

Please, have a look at :help cinoptions and :help cinoptions-values.

What you want is probably :set cinoptions=t0 or :set cinoptions+=t0.

like image 106
rodrigo Avatar answered May 12 '26 14:05

rodrigo