After configuring Vim, the pasted code cannot be indented normally
I think there is something wrong with the configuration
But I can’t find which configuration it is (I checked the configuration about indent, it’s still the same)
Vim all platforms all versions
Use my vimrc
Try copying and pasting a piece of JavaScript code, etc. (others are also acceptable)
My vimrc configuration: https://www.jianguoyun.com/p/... (Access Password:GjLkcY)
:set paste
How did you paste it? Mouse or shortcut keys? I have never encountered this kind of problem. This is my
vim
configuration file. You can refer to ithttps://github.com/HmyBmny/vi...
Can be set in .vimrc
When pasting code in the future, you can solve this problem by using <F9>. After pasting, you need to switch back through <F9>, otherwise an error will occur in the automatic indentation.
In the past, I always had problems by right-clicking paste when pasting, and I couldn’t figure it out. Until later, someone told me that I must first enter I to enter the input mode, and then I can right-click paste.
There are two ways to paste using the keyboard:
In N mode, enter "+p to paste the contents of the clipboard. This mode will not modify the indentation
In I mode, enter <Ctrl+R>+ You can also paste the contents of the clipboard, but in this way, the indentation will be affected