Search this blog ...

Saturday, January 8, 2011

vi – range replace – indent block of lines

example 1:

from line 10 through 50, insert two spaces at the start of the line

<esc>:10,50s/^/  /

example 2:

from line 10 through 50, replace the two spaces at the start of the line with empty

<esc>:10,50s/^  //