Search code examples
vimentab-detab

Entab / Detab in VIM


In normal text editors, you select the block of text and then press Tab to entab and Shift + Tab to detab.

How do I entab or detab a selected block of text in VIM?


Solution

  • If you select the text and hit ">" it will indent, and "<" will de-indent.

    Whether it inserts tabs or spaces depends on your "expandtab" setting. You can edit the number of spaces/tabstop with the "shiftwidth" and "tabstop" settings.