Change depth of indentation in vi

Steve M picture Steve M · Oct 31, 2008 · Viewed 6.9k times · Source

What's the easiest way to increase or decrease indentation for a large block of code in vi?

Answer

Harley Holcombe picture Harley Holcombe · Oct 31, 2008

In vim (not sure if this applies to you too), you use >> to indent one line. As with nearly every command in vim, type in a number before the command to perform is multiple times. So to indent the next 50 lines, type 50>>.