Unix VI CURSOR MOVEMENT

:0 or :1 or 1G Move to the first line in the file
:n or nG move to line n
:$ or G move to the last line in the file
:3,5d delete lines 3 to 5.
:5,10m20 move lines 5 through 10 to after line 20
:10,20co50 copy specified lines (10 to 20 ) and place after line  50
:1,$s/s1/s2/g global replacement of string1 with string2
:u undo last command
:.= returns line number of current line at bottom of screen
:= returns the total number of lines at bottom of screen
:set ic ( or :set ignorecase ) Ignore case during search
:set noic ( or :set noignorecase ) Restore case sensitivity (default)
:set shiftwidth=4 Set indentation to four spaces
^T set the autoindent tab one tab stop to the right
^D set the autoindent tab one stop to the left
>> shift contents of line one tab stop to the right
<< shift contents of line one tab stop to the left
h  ( or back space        or left arrow) 2h,5h Move left ( back space )
j ( or   <Return>     or down arrow ) 2j,5j Move down
k ( or  up arrow ) 2k,5k Move up
l ( or  space or           right arrow ) 2l,5l Move right ( spacebar )
[return] move to the beginning of the next line
$ 2$, 5$ last column on the current line
0 move cursor to the first column on the current line
^ move cursor to first nonblank column on the current line
w 2w, 5w move to the beginning of the next word or punctuation mark 2w, 5w
W 2W,5W move past the next space 2W,5W
b 2b,5b move backwards one word 2b,5b
B 2B,5B move to the beginning of the previous word 2B,5B
e 2e,5e end of the current word 2e,5e
E 2E,5E end of next word 2E,5E
( move to beginning of curent block ( sentence ) 2(,5(
) move to the end of current block ( sentence ) 2),5)
[ move to beginning of the paragraph
] Move to the ending of the paragraph
H 2H, 5H move cursor to the top of the screen 2H –> for 2nd line from top of the screen
5H –> for 5th line from top of the screen
M move cursor to the middle of the screen
L 2L, 5L move cursor to the bottom of the screen 2L –> for 2nd line from bottom of the screen
5L –> for 5th line from bottom of the screen

Related Posts Plugin for WordPress, Blogger...

Be the first to comment

Leave a Reply

Your email address will not be published.


*