Skip to content
Advertisement

Inserting text in vim causes each line to be shifted right

When I copy some text from one opened window (browser and text editor) to vim by pressing Shift + Insert, The text is inserted in a way that each consecutive line is shifted right with progressive amount of tabs. Meaning that second line is shifted by 1 tab, 3rd line is shifted by 2 tabs, 4th line is shifted by 3 tabs, etc. How to prevent this weird insertion and have text look in vim the same way as in the source window?

JavaScript

Advertisement

Answer

before you paste anything, try using

JavaScript

For completeness purposes, when you are done, you can go back to previous/default mode with:

JavaScript

otherwise things like autoindent would not work. (Thanks to Anurag Peshne for pointing this out.)

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement