Copy-paste from vim in a terminal yields full-width trailing spaces
*By jimrand\.\.\. on December 28, 2011 19:04 (imported from Google Code)* --- 1. Open vim. Open a file or type some text. 2. Select a range of the text with mouse click and drag, spanning multiple lines. 3. Open another window and paste. There are lots of extra spaces before the newline. Copy-paste mishandles line breaks in vim. If a selection spans multiple lines, the pasted text will contain spaces going all the way to the right margin. This is because vim uses printed spaces to clear the screen, even when there are no spaces in the file. See attached 'vimoutput.log', generated by running 'vim test.txt |tee vimoutput.log'; this contains the escape sequences vim generates. While it's debatable whether this is iterm's fault or vim's fault, I've been finding this quite annoying, and the workaround is pretty easy: add a 'trim trailing whitespace from pasted text' option. --- [com.googlecode.iterm2.plist](https://storage.googleapis.com/google-code-attachments/iterm2/issue-1677/comment-0/com.googlecode.iterm2.plist) [vimoutput.log](https://storage.googleapis.com/google-code-attachments/iterm2/issue-1677/comment-0/vimoutput.log)
issue