开发者

How do I configure indentation in vim in a specific way?

If I type the followin开发者_如何转开发g

void main(int blah,

and then press enter, I want to continue here:

          float blah);

How can I achieve this?


:set cino=(0

For more about cinoption see here.


The following commands will indent your code the right amount, using spaces rather than tabs and automatically indent after you start. The commands can be added to your .vimrc file.

set expandtab
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent

Source: http://drupal.org/node/29325


I'd suggest you also read up on the smartindent and autoindent settings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜