Vim
X: Delete the character of the cursor (same as delete)
De: Delete the ending of the word from the position of the cursor
DW: Delete the first word from the cursor position until the next word
DB: Delete the contents of the word before the cursor
DG: Delete the contents of the line at the end of the cursor
G: The cursor jumps to the specified position and enters the position before entering G
GG: End of line
GG: Beginning of the line
Ctrl+g: see where the cursor is, and how many lines of the file are displayed (display position as a percentage)
: s/old/new/g: Replaces the old line of the cursor with the new
:%s/old/new/g: Replace all old in the file with new
:%s/old/new/gc: Enter interactive mode, replace all old in the file with new (Y: OK, a: All OK, L: Only the first match is determined)
R: replace (one letter only, replace once)
R: replace (one letter, can be replaced multiple times)
U: Undo
Ctrl+r: Canceling the Undo command
There are other common ones that are not listed (e.g., dd,yy,p,i,o)
This article is from the "Linux Personal Summary" blog, please be sure to keep this source http://xuelinux.blog.51cto.com/9927651/1752780
Linux Learning one-day command (+) [VIM command]