Vi/vim is the most commonly used text editor on Unix/linux and is very powerful. Only commands, no menus.
1. Insert command
I insert before the cursor
I start inserting at the current line of the cursor
A after the cursor is inserted
A inserts at the end of the current line of the cursor
o Insert a new row on the next line of the current line of the cursor
O Insert a new row on the previous line of the cursor's current row
2. Positioning commands
: Set NU Displays line number
: Set Nonu Cancel line number
GG to the first line of text
G to the last line of text
: N to the nth line of text (: 180)
3. Delete command
X Delete the character at cursor location
N (x) × delete n characters after cursor location
DD deletes the row where the cursor is located.
NDD Delete N rows
DG deletes the line to the end of the cursor, so the content
D Delete the contents of the cursor at the end of the line
: n1,n2d deletes the specified range of rows: 100,150d
4. Replace and Cancel commands
U Undo, cancel the previous action
Ctrl + R Redo, before returning to undo
R replaces the character at which the cursor is located
R starts at the point where the cursor is located, and ends by pressing the ESC key
5. Common shortcut keys
Shift+ ZZ Save exit with same function as ": Wq"
V Enter character Visual mode
V or Shift + V Enter line visual mode
Ctrl + V Enter block Visual mode
Vim Text Editor