Vim is a file editor, pure ASCII code, is full screen editor and mode editor
Vim mode
Edit mode
Last-line mode
Input mode
Vim Mode Conversion
Edit mode-->> Input mode
I: Indicates the input mode in front of the character of the current cursor
A: Indicates that the character after the current cursor is converted into input mode
O: Indicates that a row is inserted below the current cursor and into the input mode
I: Indicates that the line at the beginning of the current cursor is converted into input mode
A: Indicates the end of the line at the current cursor is converted into input mode
O: Indicates that a row is inserted above the current cursor and converted into input mode
Input mode-->> edit mode
Esc
Edit mode-->> last line mode
Required Input: Colon
: 10d, delete line tenth
: 1,10d Delete lines 1th through 10th
: Set Nu Sets line number
:! Ls/etc can execute shell commands
Last-line mode-->> edit mode
ESC key
Input mode cannot be converted directly to the last line mode
First, open the file
Vim/path/to/file
Vim +#: Open the file and locate it on line #
Vim +: Open file positioned on last line
Vim +/pattern: Open the file and navigate to the beginning of the line that was first matched to the pattern
Second, close the file
1. Close the file in the last line mode
: W means save
: Q indicates that exit is not saved
: Wq means save and exit
:!q means not saving and exiting
: w! means forced save, only administrators have this permission
: X means save exit, equivalent to: Wq
2. Exit in edit mode
ZZ means save exit
Third, move the cursor
H: Means to move one character to the left, #h表示向左移动 # characters
J: means move down one line, #j表示向下移动 # line
K: means move up one line, #k表示向上移动 # line
L: means move one character to the right, #l表示向右移动 # characters
This article is from the "ignorance of knowledge" blog, please be sure to keep this source http://yujiqing.blog.51cto.com/1475974/1619290
Vim Editor Detailed