VI Editor
A: append at the end of line.
I: insert at begin of line.
i: insert at cursor.
a: at next cursor.
G: end of the file.
1G: Go to first line.
nG: goes to nth line.
G: end of file.
M: Middle of the screen.
H: HOME, ie, top left of the current screen.
nG: go to line n.
To search a word :?wordname
h: move cursor left one character
j: move cursor down one line
k: move cursor up one line
l: move cursor right one character
vi -r filename: recover filename that was being edited when system crashed.
o: open and put text in a new line below current line
O: open and put text in a new line above current line
r: replace single character under cursor
R: replace characters, starting with current cursor position
C: change (replace) the characters in the current line
cc: change (replace) the entire current line
dgg: delete above lines
dG: delete below lines
Command mode
Editing mode
Insert mode
Four ways of insert
i at the same cursor position
Capital A
To the end of the line.
Capital I
Begin of the line.
Small a
Next to the cursor position
To copy a single line
yy
5yy
for five lines copy
nyy
n number of lines can copy.
1G
Goes to first line
10G
Goes to tenth line
11G
Goes to eleventh line
nG
Goes to the nth position
1H
Goes up to the current screen
Capital G
Goes to the end of the page
yw
To copy a word
nyw
n number of words can be copied
x
One character delete
dw
One word delete
dd
Delete a line
ndd
n number of lines can be deleted
To replace a character
Type small r and then type character.
To replace many characters from the cursor position Type capital R
A: append at the end of line.
I: insert at begin of line.
i: insert at cursor.
a: at next cursor.
G: end of the file.
1G: Go to first line.
nG: goes to nth line.
G: end of file.
M: Middle of the screen.
H: HOME, ie, top left of the current screen.
nG: go to line n.
To search a word :?wordname
h: move cursor left one character
j: move cursor down one line
k: move cursor up one line
l: move cursor right one character
vi -r filename: recover filename that was being edited when system crashed.
o: open and put text in a new line below current line
O: open and put text in a new line above current line
r: replace single character under cursor
R: replace characters, starting with current cursor position
C: change (replace) the characters in the current line
cc: change (replace) the entire current line
dgg: delete above lines
dG: delete below lines
Command mode
Editing mode
Insert mode
Four ways of insert
i at the same cursor position
Capital A
To the end of the line.
Capital I
Begin of the line.
Small a
Next to the cursor position
To copy a single line
yy
5yy
for five lines copy
nyy
n number of lines can copy.
1G
Goes to first line
10G
Goes to tenth line
11G
Goes to eleventh line
nG
Goes to the nth position
1H
Goes up to the current screen
Capital G
Goes to the end of the page
yw
To copy a word
nyw
n number of words can be copied
x
One character delete
dw
One word delete
dd
Delete a line
ndd
n number of lines can be deleted
To replace a character
Type small r and then type character.
To replace many characters from the cursor position Type capital R
No comments:
Post a Comment