Vim enters vim on the command line and goes to the VIM editor
I press the I key and the lower end shows the--insert--insert command
ESC exit I (insert) command for other commands to use
: R file name reads into a file content and writes to the current editor
: W New file name the contents of the editor are written to a new file
: W saves the file in the process of editing, equivalent to ctrl+s in Word
:! command to temporarily leave VI to command column mode to execute the display results of the commands! For example:!ls: Execute shell command in the editing process LS
: Wq save file and exit, or ZZ (note uppercase)
: q! Force quit, do not save
: Set number causes the file in the edit to display line numbers (or: Set Nu): Set Nonumber or: Set Nonu, in contrast, do not display line numbers
: Help i view insert command assistance
U Undo Previous Action
/fedora Find Fedora characters
: S/fedora/redhat replaces Fedora characters with Redhat (replaces only the line where the cursor is located)
DW Delete Word
DD Delete Row
o Open a blank line
Vim + filename To edit the last line of the file
Vim +n file name to enter the nth line of files for editing
: 1,.s/redhat/fedora. Indicates the current line, which is the row of the cursor, and line 1th to the current line (.) The first occurrence of the redhat character instead of the Fedora
: 1,.s/redhat/fedora/g the 1th line to the current line (.) All occurrences of redhat characters instead of Fedora,g
: 1, $s/redhat/fedora/g $ represents the last line, substituting the 1th line to the last line for all occurrences of redhat characters as Fedora or (:%s/redhat/fedora/g)
:%s/\/fedora/g the Redhat word from line 1th to the last line instead of the Fedora Word, not the character!
: F Display file contents, status, etc., with ctrl+g command
: e! Current file, returning to last saved
: E File Toggle Edit files
: N switches to the next file when editing with multiple files (such as Vim file1 file2), in conjunction with: E file
VIM basic Commands