Map shift-tab in vim to inverse tab in Vim

Vim already has built-in key commands for insert mode to shift the current line left or right one &shiftwidth. They are (in insert mode):

Ctrlt : shift right (mnemonic “tab”)

Ctrld : shift left (mnemonic “de-tab”)

If you still want to use shift-tab, this is how you do it:

" for command mode
nnoremap <S-Tab> <<
" for insert mode
inoremap <S-Tab> <C-d>

Leave a Comment