Chapter III, familiar with the Vim editor
three modes : command mode , edit mode , last line mode
common commands for Command mode :
Move Cursor W B () {}, G Bottom, GG front
W is a word to move,B is the first word to move
I, I, A, a, O next line edit , o new edit on previous line , S, s
DD cut one line , 2DD
yy copy , 2yy
P Paste p is pasted on the previous line
U cancel last operation, CTRL + R repeats last action
V Visual Mode
Esc
edit mode is I, and insert the contents in front of the cursor
last-line mode : Yes to search
shift+:
W Save
Q Quit without save
Q!
W!
Wq
Setnu
Setnonu
10
/
: Set Nu can see line numbers
:Set Nonu
: one cursor to one number
/s/root/admin found replaced with admin
: 2,7s/:/-2 to 7 rows: Replace with -
:%s/:/-g Entire text replacement
This article from "hcie_38xx" blog, declined reprint!
Rh134-03 familiar with the VIM editor