Home » Questions » Computers [ Ask a new question ]

How to add a new line with the same indentation

How to add a new line with the same indentation

Then I press Enter in Insert mode, a new line is created, but the cursor is placed at the beginning of the line.

Asked by: Guest | Views: 332
Total answers/comments: 2
bert [Entry]

Adding set autoindent to your ~/.vimrc can do that for you automagically.
bert [Entry]

"Both will annoy you when pasting, as Vim will try and indent everything on the fly.

Prior to pasting enter:

:set paste"