15

How to enter a tab character in vim with SuperTab plugin enabled?

14

I've not used this extension myself, but I would guess that ^V-Tab might work. ^V in general can be used in insert mode to insert a literal keystroke instead of whatever that key is mapped to do. So you type Control-V, then hit whatever key or key combo you want to insert literally.

  • 1
    In the ^V docs at :help i_^v: "Note: When CTRL-V is mapped (e.g., to paste text) you can often use CTRL-Q instead." See :help i_^q. – Rory O'Kane Apr 5 '13 at 18:05
4

If you want to simulate pressing <tab> as if SuperTab were not installed (i.e. you want to insert a tab that respects your :set expandtab settings) then press Ctrl-Tab.

^V-<tab> inserts a literal tab. If you have :set expandtab enabled then this might not be what you want, because it inserts a real Tab character, not a series of spaces.

2

You could also use the indent functionality by typing >> which depending on your indent settings would use a tab character.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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