One, when the Vim is not installed, prompt installation
[Email protected]:~/test$ VIM ABC
The program ' Vim ' is already included in the following packages:
* VIM
* Vim-gnome
* Vim-tiny
* Vim-athena
* Vim-athena-py2
* Vim-gnome-py2
* VIM-GTK
* Vim-gtk-py2
* VIM-GTK3
* Vim-gtk3-py2
* Vim-nox
* Vim-nox-py2
Please try: sudo apt install < selected packages >
Second, vim common instructions
Cat ABC//OPEN ABC file
VIM Editor has three modes, command mode, input mode, low line mode
just opened the file is the command mode,
Press "I" to enter input mode
Press "ESC" to enter low-line mode (also command mode)
VIM + ABC//Open ABC file cursor directly to the last line
VIM +3 ABC
VIM +10000 ABC
VIM +/search ABC//Open ABC file, cursor directly to the first "search" hit position, press ' n ' to toggle the cursor position
vim AA bb cc//Opens AA bb cc file together, if not then create the file
enter in low-line mode: next/:n,:p rev/:n
low-line mode common directives:
: w
: Q
: Wq
:!//Mandatory
: 6//cursor positioned on line 6th
/xxx//Cursor position backward search XXX
? XXX//Cursor stop position search forward xxx
h cursor moves left
J down
K on
L Right
Ctrl + F PAGE DOWN (front)
Ctrl + B page Up (back)
Ctrl + D turn down half page (down)
Ctrl + U Upside down Half page (UP)
Command mode common directives:
DD Delete the line where the cursor is located
o Insert a row below the cursor line and switch to input mode
yy copy cursor is located in the row below paste
p paste below the line where the cursor is located
P paste (uppercase) above the line where the cursor is located
Use of the VIM editor