Then I press [Enter] in insert mode, there is a new line. But cursor places in the very beginning of a line. What do I do to create new line with the same indentation as the current's?

link|improve this question

50% accept rate
1  
I recommend that you spend a little time Googling for 'vim configuration' or the like. There's a ton that you can set in your ~/.vimrc file. – Telemachus Jan 23 '10 at 21:24
feedback

3 Answers

up vote 2 down vote accepted

add set autoindent to your ~/.vimrc can do that for you automagically.

link|improve this answer
thanks! there was no .vimrc, is it ok to create a new one? – valya Jan 23 '10 at 21:13
yes, under your home directory. – John T Jan 23 '10 at 21:15
feedback

Both will annoy you when pasting (as vim will try and indent everything on the fly). So prior to pasting:

:set paste

link|improve this answer
feedback

I'd also suggest adding this to your .vimrc:

set smartindent

It will increase the indent in a new block.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.