Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I like c.vim plugin, but I don't use K&R code style

Tags:

c

vim

plugins

When I write code, I'd like to use ANSI C style, but the code style in c.vim template is K&R.

Where can I get another template or any other plugin instead of c.vim?

like image 599
Yucoat Avatar asked Dec 06 '11 10:12

Yucoat


1 Answers

You should check :help cinoptions-value and define your own C style.

IIRC, you need to set cindent so that cinoptions are taken into account.

FWIW, it is what I do when opening a C or h file :

setlocal cinoptions={0,:1s,g1s,t0,(0,=.5s
setlocal noautoindent
setlocal nosmartindent
setlocal cindent
like image 103
Xavier T. Avatar answered Nov 03 '22 01:11

Xavier T.