indenting contnued line

23 views
Skip to first unread message

rudrab

unread,
May 24, 2013, 8:03:34 PM5/24/13
to vim...@googlegroups.com
Hello friends,
for a continued line, say, in C,
void some_function(argument1,
more_arg)

is the natural behavior of vim (with my current vimrc).
I want it to be like
void some_function(argument1,
more_arg)

i.e. when I press enter after reaching the end of first line, cursor should come to the suitable position, rather then first column.

This will happen if my argument list is longer, and if I manually shift the 2nd line at the position I like, third line will come directly below it. But 2nd line has to be shifted manually.
Whats more, using autoindent (shift+G+=+G) will also shift them bact to column 1.
any solution?

Ben Fritz

unread,
May 24, 2013, 8:19:45 PM5/24/13
to vim...@googlegroups.com

Try turning on filetype-based indentation.

Near the top of your .vimrc, put:

filetype indent on

or

filetype indent plugin on

http://vim.wikia.com/wiki/Indenting_source_code#Methods_for_automatic_indentation

Reply all
Reply to author
Forward
0 new messages