The Vim tool on the Linux platform can be said to be very well known and powerful, so this tool has to be said!
Use the command vi file name directly to create and edit the file.
Three modes of VIM:
Command mode;
Insert mode:
Bottom line mode;
The default entry is command mode. In command mode we can enter a number of commands, here are some common commands:
Ctrl+b back Page
Ctrl+f Page Forward
0 move the cursor to the beginning of the line
$ moves the cursor to the end of the line
G move the cursor to the end of the file
1G move the cursor to the top of the file
N G move the cursor to the [n] Line
[n]+ moves the cursor down [n] Lines
[n]-moves the cursor up [n] Lines
X Delete the character at the cursor position
DD Delete the line where the cursor is located
[N]dd deletes the row and the following [n] lines of the cursor
YY copy when moving forward
[N]yy Copy the current line and the next [n] Line
P Paste
U Redo Last Action
/Find content Cursor search backwards
? Find content Cursor forward lookup
N Continue looking down
Command mode switch to insert mode: Key I,a,o
Insert mode Toggle Command mode ESC key
Command mode input: Enter the bottom row mode (some bottom line mode command)
: W Save
: Q exit
: q! Force exit, do not save file
: Wq save File and exit
: W file name to save the file as the filename
: Set NU Displays line number
: Set Nonu suppress line numbers
These are only a small part of the Vim tool, but for beginners, these commands are sufficient. More advanced commands can be found in the official manual, which is detailed in the description.
The basics of using VIM