One: page
Ctrl+u up half a page
Ctrl+f up one page
Ctrl+d down Half page
Ctrl+b down one page
Two: Move cursor command
0: Cursor moves to the beginning of the current line
$: Cursor moves to the end of the current line
Three: Common INSERT, delete instructions
I: Insert before current cursor, text moves backwards after cursor
DD: Delete the line where the cursor is located
YY: Copy Current line contents to Clipboard
P: Pastes the contents of the Clipboard after the current cursor position
P: Pastes the contents of the Clipboard before the current cursor position
S: replaces the specified number of characters with the input text starting at the current cursor position
S: Deletes the specified number of rows and replaces them with the input text
Do: Delete to the beginning of the line
d$: Delete to end of line
Iv. Find, save and Exit VI
Press u--to cancel the most recent operation, which can be reversed as many times as you like.
Press u--to cancel all edits made to the current line. : w--Save current file
: wq--Save (same as command: x function)
: q--Direct exit, if modified will prompt to save
: q! --Do not save direct exit
Open a new file or read into other file contents
In the current VI editor, you can edit a new file by executing the last line command in the form ": E New file ".
In the current VI editor, the last line in the form of ": R other file " reads the contents of the other file and copies it to the current cursor location.
In the current VI editor, execute the ": R! Command " form of the Mo-line mode, you can paste the output of other commands to the text file cursor location.
Execution of the "Set number" command in the last row mode displays line numbers, and "Set Nonu" is performed to suppress line numbers.
Vi. useful parameters for the VIM editor
vim-o file1 file2; two files will be opened at the same time, displayed up and down, using ctrl+w to toggle files.
vim-o file1 file2; will open two files at the same time, left and right display, use CTRL+WW switch files.
Linux uses text editor VI common commands