Summary of the most VIM commands used by python engineers

vim is a text editor developed from vi, and there are many commands, but I summarize the most commonly used ones:

.1 The working mode of vim: 1. Command mode 2. Edit mode 3. Last line mode, command mode to enter edit mode use: i command mode to enter last line mode use:, edit mode and last line mode cannot be switched directly, you need to return to Go to command mode: esc
.2 vim common commands
yy: copy the line where the cursor is located, number+yy: copy multiple lines
p: paste, number+p: paste multiple times
dd: cut (delete)
V: select multiple lines, y: Copy the selected line
shift+4: go back to the end of the line
shift_6: go back to the beginning of the line
G: go back to the last line
gg: go back to the first line
Number +G: go back to the specified line
>>: indent to the right
<<: go to the left Indent
.: Repeat the last operation Up,
down , left and right: Use the arrow keys, k: up j: down h: left l: right
: / search content, n: means the next search content, N: means the previous search content
:% s/1/2/g %: Indicates the entire file 1 Indicates the content to be replaced 2 Indicates the content after replacement g: Global replacement
: 1,10s/2/3 Indicates content replacement in the specified line
Undo : u

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325660312&siteId=291194637