Marco Caggiano
Marco Caggiano

Reputation: 1

How indent line like emacs and netbeans in vim?

I've searched on google but i've found nothing ! When i'm in vim, and i am on a line, like called line x, i want that hitting tab, will make all the line indented, and not just the character. How i do that ?

Thanks !

Upvotes: 0

Views: 381

Answers (1)

Gustavo Giráldez
Gustavo Giráldez

Reputation: 2690

In insert mode, hit Ctrl-T to indent and Ctrl-D to deindent.

In command mode, use the shift commands < and >. Those accept count prefixes, movement suffixes and regions like most other Vim commands. To work only on the current line, hit the corresponding key twice.

When indenting regions, after the shift command you lose selection. Hit . repeat the shift on the same region.

You can also use = in command mode to autoindent.

Upvotes: 6

Related Questions