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.

Current it quits the visual mode after indenting once,which is very annoying.

share|improve this question
3  
For indenting more than once, simply use the . key to repeat the last operation –  barbaz Jul 14 '11 at 9:47
add comment

1 Answer

up vote 7 down vote accepted

You can use the normal mode command gv to highlight the previous visual selection. Therefore, you could use the following mappings:

:vmap < <gv
:vmap > >gv

The :vmap command sets up a mapping that will work only in visual mode. You are therefore rebinding the < and > visual mode commands to perform the indent and immediately re-select the previous visual selection.

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.