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

So I was looking for a way of indenting multiple lines in vim and someone suggested doing

:map <Tab> <

and all it does is insert the < character whenever I press tab (How did I not see it happen). I tried to do :map <Tab> <Tab> and :map <Tab> \t to bring back regular indenting, with no success. I am new to vim key mapping so I would really appreciate help. Also if someone could point out how to indent multiple lines in vim, that would be awesome.

Thanks in advance!

share|improve this question

migrated from Jun 23 '13 at 6:22

This question came from our site for professional and enthusiast programmers.

:unmap Google is your friend. – Adam Liss Jun 22 '13 at 21:49
@AdamLiss Google has been my friend, my friend, for so long. – Grigor Jun 22 '13 at 21:56
up vote 10 down vote accepted

:unmap <Tab> to get the default behavior back.

use :x>> to indent x number of lines (from where the cursor is)

share|improve this answer
:unmap <Tab> doesn't do the trick.. for some reason :/ – Grigor Jun 22 '13 at 21:54
this works for me. – doubleDown Jun 23 '13 at 1:20
@Grigor In your question you claimed that you used map <Tab> <. To undo this correct command is indeed unmap <Tab>, but the next text (“all it does is insert the < character”) means that original claim is false. There is no way you could insert < with such mapping, but it would be true if you have written imap <Tab> <. This command is undone using iunmap <Tab> (note the i in both commands). To get correct answers you must be precise. – ZyX Jun 23 '13 at 18:22

This solved the issue to revert back tabbing.

:imap <Tab> <C-t>
:imap <S-Tab> <C-d>

Pressing Tab indents the code, Shift-Tab reverts indentation the code.

share|improve this answer
you can also use :iunmap <Tab>. If <Tab> is mapped by :imap, you have to use :iunmap to unmap it. :unmap <Tab> doesn't work in this case. – Hai Feng Kao Sep 4 '15 at 7:54

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.