I am using screen to copy code that I am viewing using Vim from one window to another window currently editing a file with Vim. Unfortunately, when pasting onto the second window I get increasingly more white space to the left of my input after every newline. How is this whitespace finding its way onto my buffer?
I've attempted to turn off auto indenting in case Vim was adding the extra whitespace, but the problem persists.
Here is information that might be pertinent:
Are you copying using the mouse or some other non-vim ways? If yes you must do :set paste
before pasting and :set nopaste
after. See :h pastetoggle
for a quick mapping.
If all your vim sessions are local and Vim supports it (:echo has('clipboard')<CR>
should echo 1
), you should use your system clipboard: "+y
to yank and "+p
to paste without that pesky indenting.
Or, better, open your files in the same Vim session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With