After enabling set mouse=a
, text copied inside of Vim will not paste outside of Vim. Does anybody know of a way to fix this?
Here, selecting text with the mouse turns on visual mode and disables the Copy
option in the popup menu:
After enabling set mouse=a
, text copied inside of Vim will not paste outside of Vim. Does anybody know of a way to fix this?
Here, selecting text with the mouse turns on visual mode and disables the Copy
option in the popup menu:
You can use
:set mouse&
in the vim command line to enable copy/paste of text selected using the mouse. You can then simply use the middle mouse button or shiftinsert to paste it.On OSX use fn instead of shift.
Press shift while selecting with the mouse. This will make mouse selection behave as if
mouse=a
was not enabled.Note: this trick also applies to "middle button paste": if you want to paste in vim text that was selected outside, press shift while clicking the middle button. Just make sure that insert mode is activated when you do that (you may also want to
:set paste
to avoid unexpected effects).OS X (mac): hold alt/option while selecting (source)
Instead of
set mouse=a
useset mouse=r
in .vimrcIn ESC mode, when set mouse=a, select the text using mouse. This would enable the visual mode in vim. Then you can press 'y' to yank the selected text and 'p' to paste it wherever you want. This happens only within vim.
If you are using, Putty session, then it automatically copies selection. If we have used "set mouse=a" option in vim, selecting using Shift+Mouse drag selects the text automatically. Need to check in X-term.