Question

My workstation is MSWindows with puTTY as my xterm/ssh client to linux servers. The way things work that I'm used to in linux is left mousedrag selects, rightclick pastes, and I wanted to be able to copy/paste between Windows, gvim, and putty. I don't know if this is the best way to do it, but here's what I put into my $HOME/_vimrc on my MSWindows workstation to make it all work:

set clipboard+=unnamed
set paste
set go+=a
set mousemodel=extend
noremap <RightMouse> <MiddleMouse>
noremap <MiddleMouse> <RightMouse>

Basically, I swapped the right/middle mouse buttons, disabled the context menu that comes up by default when you rightclick (even after swapping), enabled pasting and set the copy/paste buffer to the system one.

Is there a better solution?

Was it helpful?

Solution

You can set the 'selectmode', 'mousemodel', 'keymodel', and 'selection' options with

:behave xterm

(for your preferences) or

:behave mswin

(for the sake of others who may be reading this). Also, make sure that $VIMRUNTIME/mswin.vim is not being sourced. (Check with :scriptnames. Depending on how you installed vim, there may be a system vimrc file that :sources this file.) For more information, read

:help gui-mouse
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top