How do I indent a single line multiple times in vi or vim?

Cory Klein picture Cory Klein · Sep 13, 2010 · Viewed 10.4k times · Source

I've found several answers on how to indent multiple lines in vim, I want to know how to take a single line and indent it more than once. In effect, I want a shorter version of the following command: ">>>>>>>>>>" (That is 10 right bracket "greater-than" signs.)

Answer

ldog picture ldog · Sep 13, 2010

Select what you want (typically with v or Shift+v) then type 5>.

If you need to fix or repeat the same selection, use gv.