Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I add and remove tabs in normal mode in vim? Also, how can I add and remove tabs in visual mode (like selecting a code block in a regular editor and hitting tab or shift tab?

share|improve this question
up vote 1 down vote accepted

in visual mode: select some text, usually a line with V and then hit Shift > or Shift < (to untab)

edit: if it's a line you want to indent then you don't have to select a line, just put the cursor on any line and hit the above shortcuts.

share|improve this answer
Or try gq for autoformatting. – frabjous Aug 6 '11 at 14:21

That would be the < and > commands.



Shift the current line one tab to the right


Shift the next ten lines one to the left


Shift the lines from the cursor to the mark a one to the right


Shift the current line, and the one below it, one to the right.

Which is, of course, the generic >{range}, so very flexible.

share|improve this answer
Replacing >/<with = is often when you format your code. – tidbeck Aug 6 '11 at 15:43

Your Answer


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.