On my local computer, I have the following in ~/.vimrc
, which allows me use to the mouse (e.g. to select text) and to copy to the system clipboard with Ctrl+c.
set mouse=a
vnoremap <C-C> "+y
Having set mouse=a
means I can copy the "real" text, rather than what the terminal interprets (e.g. with control characters and whitespace). Paradoxically, it also lets me select text without the mouse to copy. Without this setting, I need to use the mouse.
If I have these settings on a remote computer, and I enable X11 forwarding, I can also copy directly into my local clipboard.
However, I have a version of vim
installed on another server compiled without +clipboard
. Here, copying fails. Is it possible to copy directly into my local clipboard, while still having set mouse=a
?
alt
key while selecting text.set mouse=a
, the cursor moves to the first place I click, and nothing more happens.alt
doesn't work,shift
or middle/right click dragging might.shift
works perfectly. Thank you. If you put that up as a workaround, I'll upvote it (but will delay accepting for a better solution, if it exists). TBH it is slightly better than not havingset mouse=a
, but still doesn't let me copy the real text, nor copy using visual mode.