1. Under Vim paste a large piece of Python code, but from a line start all more back a tab, there are more than 100 lines, one by one, I manually adjusted, tired half dead.
Solution:
In Vim, it's best to go to paste mode before pasting the code, which turns off auto indent
Set paste
Paste the code in and then close paste mode
Set Nopaste
Ps:vim cannot know that you are pasting (non-GUI version, no mouse support is turned on in the terminal or the terminal itself does not support the mouse,
Because VIM does not have X Clipboard support to bypass Vim, use the Shift key method to paste the terminal directly
(such as when Vim is pasted into SSH, it is usually
Vim does not have access to the local clipboard, so the terminal can only "type"),
Then you need to set the ' paste ' option before pasting. This option disables automatic indenting, mapping, and so on in insert mode
2. How the Zone indents:
A. Ctrl + v selected, then shift +i, enter a space or tab, and finally ESC
B.
:10,100>
Line 10th to 100th indent
:20,80<
Line 20th to 80th anti-indent
C.
Indent a single line code is two greater than sign ' >> '
Retraction is two less than sign ' << '
If you want to indent a lot of lines of code, do it as follows
Press ' V ' to enter selection mode here
Aaaaaaaaaaaaa
bbbbbbbbbbbbbbb
Ccccccccccc
Ddddddddddd
Move the cursor here, press once greater than > ' indent once, press ' 6> ' indent six times, press ' < ' to retract. The following same
Vim Usage Tips