I,
Official Website
Www.vim.org
II,
VI Working Mode
Command mode, insert mode, and edit mode.
III,
Go to VI
1.
Use VI to open a file.
2.
Directly go to the specified location.
1)
Vi + 20/etc/passwd
2)
Vi +/root/etc/passwd
IV,
VI Basic Applications
1.
INSERT command: I, A, O.
2.
Cursor movement command
1)
Movement in characters: H, J, K, L
2)
Move in words: W, B, E
3)
Move to the beginning or end of a row: $ (N $), 0
4)
Move to the specified character in a row: F (move the cursor to a specific character in the current row, FA)
5)
Move to matching brackets: %
6)
Move to the specified row: NG
7)
Move to the last line: gg
3.
Use VI for editing
1)
Search for a string: "/string to be searched" (Backward Search), "? The string to be searched (Forward search),/^ root (the row ending with root), And/root $ (the row starting with root)
2)
Replace with VI: ": Replace the start position, replace the end position S/string to be replaced/Replace the string/g" (for example, ": 1, $ S /:/, /g)
3)
Use VI to delete, paste, and copy: X, DD, NDD, P, YY, nyy, J, U, CTRL + R (excessive undo, re-Execute UNDO)
4.
Save the exit command: W, Q ,!, W
Path/new file name, ZZ (in command mode)
V,
VI advanced applications
1.
Show row number: Set Nu, set Nonu
2.
Multi-Window Editing: ": SP another file", CTRL + W + k, CTRL + W + J, ": R
Copied file name"
3.
Copy region: Ctrl + V-> select region-> Y-> move to target location-> P
4.
Interaction with Shell in VI ::!
Command