After configuring Vim, Vim cannot indent normally when copying and pasting code.
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 16:35:29
0
5
601

Describe the problem

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)

Context

  1. Vim all platforms all versions

Reappearance

  1. Use my vimrc

  2. Try copying and pasting a piece of JavaScript code, etc. (others are also acceptable)

Related codes

  1. My vimrc configuration: https://www.jianguoyun.com/p/... (Access Password:GjLkcY)

Error message

Related screenshots

What methods have been tried but still have no solution (relevant links attached)

Problem simplification

过去多啦不再A梦
过去多啦不再A梦

reply all(5)
洪涛

:set paste

过去多啦不再A梦

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 it
https://github.com/HmyBmny/vi...

为情所困

Can be set in .vimrc

set pastetoggle=<F9>

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.

Ty80

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template