Pasting text in vim makes each line shift to the right
When I copy text from one open window (browser and text editor) into vim by pressing Shift + Insert, the text is inserted in such a way that each consecutive line is shifted to the right with a progressive number of tabs. This means the second row is shifted 1 tab, the 3rd row is shifted 2 tabs, the 4th row is shifted 3 tabs, etc. How can I prevent this strange insertion and view the text in vim the same way as in the original window?
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()
source to share
: install paste
will disable automatic indentation in vim. After pasting, use :set nopaste
to re-enable the auto indent feature in vim
But if you find it annoying to switch between paste
and nopaste
, just use case +
to insert:
"+ p
This will ignore any insert options in vim, just insert them like. it.
More information about the system clipboard register: http://vim.wikia.com/wiki/Accessing_the_system_clipboard
source to share