Vim has been used for a while, but it is still at the cainiao level. Write down frequently used shortcut key commands:
CTR + Z: equivalent to ESC
CTR + P: Code Completion DD: Cut P: paste Y: Copy Za: fold format code: Gg = g remarks:
Gg -- arrive at the beginning of the file
= -- Requires indentation
G -- until the end of the file
Jump to function and variable definition:
[+ Ctrl + I: Jump to function, variable, and # define [+ Ctrl + D: Jump to # define Ctrl + I: jump forward to the previous few cursor positions
CTRL + O: jump back to the last few cursor positions
Function body jump:
[[
]
[]
] [
{}
In normal mode, the cursor stops on a character. Ga can view the ASCII code of the character.
# Copy, delete, and paste operations: Press V (SHIFT + V) to enter the visual mode, select the desired row from the upper and lower of JK, and then press
Y Replication
D. Delete
X cut
P Paste
Jump to a line:
,+ Row number encoding: set encoding = UTF-8 # Fix garbled characters
Set fileencodings = ucs-bom, UTF-8, cp936, gb18030, big5, EUC-JP, EUC-KR, Latin1