Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

At the moment if I use 'o', then the inserted line is auto-indented properly. Should I do '2o' however (followed by esc to realise it), I'm of course not in insert mode and the cursor is unindented. This is quite tedious.

How am I best to deal with this problem? Ideally I'd like to end up correctly indented and in insert mode after '2o' (or some equally convenient combination) - no doubt this is a problem others have encountered and solved.

Thanks in advance.

share|improve this question
    
Just hit <Enter> after o. –  romainl Mar 20 '13 at 15:11
add comment

1 Answer

I'm not sure what behavior you want in general. I would do what romainl suggested. You might also try this:

:set indentexpr=indent(prevnonblank(v:lnum-1))

That will cause any line you add to be indented the same as the previous non-blank line.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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