Tuesday, December 4, 2012

vi editor command's in linux

Friend's I present you all command's of  vi editor  in Linux

Command        Description
i                        insert mode, (ESC to exit insert mode) allows text to be entered on the screen
a                       Append to right mode
/word               Move to the occurrence of "word"
n                      Locate the next occurrence
w                     Advance to the next word
e                      Advance to the next end of a word
b                      Move to the previous word
3b                    Move backward 3 words
yy                    Copy line (then move cursor and use p to paste after current cursor line)
dd                   delete line
3dd                 delete 3 lines
D                    Delete remainder of a line
dw                  Delete word
x                     Delete character
o                    Open space for new line below the cursor line
O                   Open a line above the cursor
CTRL- w       Move back a word in append mode
u                    Undo last
U                   Undo all changes to current line
.                    In command mode, repeat the last text changing the command on the current line
:wq               save and quit
:q!                 quit without saving
r                    replace then typa a character ot be replaced with r then return to break up a line
J                    join 2 lines
s                   substitute (sentence) typed text over a character, ESC when done
cw                change word
c                   change part of a line from the cursor to the end of the line
cc                 substitute new text for aline, ESC when done
h                  move the cursor back one space
H                 move the cursor to the highest line on the screen
 L                move the cursor to the lowest line on the screen
M                position the cursor at the midpoint on the screen
G                 last line in the file
0 (zero)            Move the cursor to the beginning of the line it is on
view filename   Open a file for viewing only
set number       Turn on line numbers
set nonumber    Turn off line numbers

No comments:

Post a Comment