In vim, I use the indentLine plugin and set list listchars=tab:\ \ ,trail:.
is activated in my vimrc, so that vim displays begin-of-line spaces as pipes "|" and end-of-line spaces as dots.
When mouse-selecting in vim and pasting into the R console (using middle click), these "special characters" are included in the R console, leading to errors.
Is there a way to select-middle-click-paste only the content rather than all the characters displayed in vim?
(note: This is under an up-to-date ubuntu linux)
Asked
Active
Viewed 268 times
1

meriops
- 997
- 7
- 6
1 Answers
0
When the terminal (not Vim) performs the selection, it captures all visible screen characters (so :set number
would cause such problems, too).
The solution is to let Vim yank the buffer contents. If you have a visual selection, that can be done via "*y
, or :[range]yank *
. The *
is the mouse selection register; there's also the clipboard register +
, cp. :help quotestar
.
To keep using the mouse for selection, you have to change the 'mouse'
option, e.g.:
:set mouse=a
Note that all of this depends on proper clipboard support in Vim, and mouse support in the terminal.

Ingo Karkat
- 167,457
- 16
- 250
- 324