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
x
while True:
reads = [p.stdout.fileno(), p.stderr.fileno()]
ret = select.select(reads, [], [])
for fd in ret[0]:
if fd == p.stdout.fileno():
read = p.stdout.readline()
Advertisement
Answer
before you paste anything, try using
JavaScript
:set paste
For completeness purposes, when you are done, you can go back to previous/default mode with:
JavaScript
:set nopaste
otherwise things like autoindent would not work. (Thanks to Anurag Peshne for pointing this out.)