next up previous contents
Next: Automatic Indenting Up: Guide to VI and Previous: Repeating a Text Change

Shifting Lines Horizontally Left or Right


>> n>> moves 8 columns right one or n lines
<< n<< moves 8 columns left one or n lines
:init,end> shift 8 columns right from init to end
:12< shift 8 columns left 12 lines from current pos


The default value for shiftwidth is 8, but it can be altered using:

:set shiftwidth=n

where n is the number of columns to shift.



It is also possible to shift a text block using markers (named by one lowercase character from a to z), first move the cursor to the desired starting position and mark it by typing:


ma mark cursor pos with name a


then move the cursor to the ending position and type:


>'a right shift text block starting at marker a
<'a left shift text block starting at marker a


For more details about markers see also Setion 24.


next up previous contents
Next: Automatic Indenting Up: Guide to VI and Previous: Repeating a Text Change
Marisa Luvisetto
2000-12-20