Use of the vim editor in linux and the vim editor in linux
Vi or vim editor is an indispensable editor. There are many editors available on windows, such as notepad, notepad ++, and edit,
But in linux, it is basically vi or vim. vim is bigger than vi, and it is an enhanced version of vi. Therefore, it is necessary to learn about vim.
Use the vi text editor to edit the generated file
* ***** Basic usage
Vi? Somefile.4
1. First, the system enters "Normal Mode". This mode only accepts various shortcut keys and cannot edit the file content.
2. Press the I key to enter the editing mode from the normal mode. In this mode, all files are typed in.
3. After editing, Press Esc to exit the editing mode and return to normal mode;
4. Press: To enter the "baseline command mode", enter the wq command, and press Enter.
* ***** Some common shortcut keys
Some useful shortcut keys (used in normal mode ):
A? Insert at the end of the cursor
A? ? Insert at the end of the row
I? ? Insert at the beginning of the row
Gg? ? Directly jump to the first line of the file
G? ? Directly jump to the last line of the file
Dd? ? Delete a row. If? 5dd? ?, Delete the 5 rows after the cursor at a time.
Yy? Copy the current row ,? Copy multiple rows, then? 3yy, copy the three rows near the current row
P? ? Paste
V? Enter the character selection mode. After the selection is complete, copy by y and paste by p.
Ctrl + v? Enter the block selection mode. After the selection is complete, copy by y and paste by p.
Shift + v? Enter the row selection mode. After the selection is complete, copy by y and paste by p.