31
8
I'm running Vim 7.3 under Linux Mint 13 (using MATE) and I'm not able to save text to the system clipboard. I run Vim in the terminal and copy text from the terminal with CTRLINSERT. When I select text in Vim (either with the mouse or in visual mode), CTRLINSERT doesn't copy any text. In addition when I right-click, Copy is grayed out. Further, I can't write to the system buffer by yanking to the corresponding register using vim commands. However, I'm able to paste while in insert mode (using SHIFTINSERT or right-click paste). I'm also able to copy text directly from the terminal using the same technique, just not text from Vim.
Here is my current ~/.vimrc. The relevant part is most likely set clipboard=autoselect,unnamed,exclude:cons\|linux
. If I put finish
at the top of my ~/.vimrc, I have the same issue, so I think the line is wrong, but I've tried set clipboard=unnamed
and had the same behavior.
Could there be another config file affecting Vim's behavior? How can I change my ~/.vimrc to allow me to copy text from Vim?
Good answer. Just a plus: more mouse modes here
:help mouse
– Dr Beco – 2014-08-25T21:42:37.663Just the tip of holding shift while highlighting was spot on. I use the primary (highlight + middle mouse click) copy/paste all the time. Thanks. – James – 2014-10-11T12:58:39.223
After being frustrated by this for YEARS, you have saved me a lot of future misery! – hopeseekr – 2019-05-05T15:26:34.873
no matter what I do the mouse defaults away from whatever I select. – Richard – 2019-09-28T20:48:50.920
Thanks, solved my pain. What I don't understand is why Vim (8.1 for me) sets
mouse=a
as default? This is very frustrating. – ibic – 2019-12-30T11:36:25.2072
While this might actually solve their problem an explanation of why it works would be more useful. Without it your answer is just telling someone to Press the Green Button Twice - It might work, it might not, but it doesn't enlighten them.
– voretaq7 – 2012-06-11T16:06:55.410Thanks, that solved it. The explanation you added after voretaq7's comment helped a lot, too! – None – 2012-06-11T20:49:06.143
This works for Cygwin, too. – Dave Jarvis – 2012-11-21T00:22:38.600
1This mode will highlight everything, so if I want to copy a few lines, I'm also copying line numbers and all the empty space after each line until the end of the screen. Is there a way to only have it select the relevant content (which is how highlight works when
mouse=a
)? – Dennis – 2014-03-12T18:08:34.663