1. Mobile
$: Move to end of line
0: Move to the beginning of the line
G: Jump to the beginning of the last line
GG: Jumps to the beginning of the first line
+: Move to the beginning of the next line
-(not minus): Moves to the beginning of the previous line
2. Find
/string find String, enter, press N to jump to the next, N Previous. Press the up and down keys to find the previously searched records after pressing the/key again.
3. Add password
":" + "X": Prompts you to enter the password two times. After: Wq save exit. You will be prompted to enter your password when you re-enter. If you do not want the password, it is: X prompts you to enter the password two times in a row to press ENTER, it is done.
4. Copy and paste, delete and revoke
DD: Delete a row
U: Perform one recovery
YY: Copy one line
P: Paste a line
5. Display line Numbers
1. Execution of each open file: Set Nu
2.
Locate the current user's VIMRC file. If you do not have this file, you can create this file.
Vim ~/.VIMRC
After opening the file, add the last
Set Nu
Wq exit.
Open with Vim again to display the line number.
vim-Common shortcut keys