views:

235

answers:

3

If I type the following

void main(int blah,

and then press enter, I want to continue here:

          float blah);

How can I achieve this?

+6  A: 
:set cino=(0

For more about cinoption see here.

Federico
A: 

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

kguest
smartindent is obsolete. It's best to pretend it doesn't exist. The general indentation settings that should be in your ~/.vimrc are "set autoindent" and "filetype indent on". The former is so you have a basic "return to the level of the previous line" behavior when there is no filetype-specific indentation. The latter is to enable use of filetype-specific indentation.
jamessan
A: 

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

Jigsaw