1.vim use
1.vim Access
Vim 1.py has file open no file New
2. Command mode
: Enter the last line mode
3. Last-line mode
: Wq Save and exit: Q Quit!
4. Insert mode ESC exits to command mode
Insert
Press I (inserted before cursor position)
Press A (insert behind cursor position)
Press O (cursor position, next line, insert)
Press I (inserted at the beginning of the cursor position)
Press A (insert at the end of the cursor position line)
Press O (the cursor position, up to another line, insert)
Move
H: Ex J: Lower K: Upper L: Rear
M: Jump to Middle row
L: Skip to last line
G: Jumps to the specified line (number of rows in front of G)
W: Move backward one word
B: Move one word forward
GG: Jumping to the beginning of a file
{: Move a piece of code upwards
}: Move a piece of code down
Ctrl+d: Turn half screen down
Ctrl+u: Half screen upward
Ctrl+f: Turn up full screen
Ctrl+b: Turn the entire screen down
Delete
X: Delete one character forward
X: Delete one character to the back
DD: Delete a whole line (DD front plus number to delete multiple lines)
D0: Delete all the contents of the bank before the cursor
DW: Delete the contents of the line after the cursor starts (including the deletion of the cursor)
Revoke
U: Step-by-step undo
Ctrl+r: Anti-revocation
Copy
YY: Copy (number of lines can be duplicated in front plus digits)
P: Paste
Replace
R: Replace the current character
R: Replaces the character following the current cursor, and the cursor moves backwards
Find
/123: Find
N: Previous
N: Next
In the last line mode:
Bulk substitution:
%s/123/456/g Replace all of the 123
1,10s/123/456/g Replace 1 to 10 rows of 123
2.vim Edit py File
Python3 1.py
F5
3.input, Print
Input inputs
Print output
A = input (' Please enter a number ') print (' The number you entered is:%s '%a)
A = input (' Please enter the first number:'= input (' Please enter the second number:'= == a + bprint(' The result of the addition is:%s'%num)
Configuring Plug-ins Bash install.sh
Virtual Environment Workon Py3env
Use vim to edit Python