This behavior works fine on gVim if the mouse is enabled (:set mouse=a
) and the 'selectmode'
option is at the default value:
*'selectmode'* *'slm'*
'selectmode' 'slm' string (default "")
global
{not in Vi}
This is a comma separated list of words, which specifies when to start
Select mode instead of Visual mode, when a selection is started.
Possible values:
mouse when using the mouse
key when using shifted special keys
cmd when using "v", "V" or CTRL-V
See |Select-mode|.
The 'selectmode' option is set by the |:behave| command.
But it doesn't seems to work in my terminal. You can find the details in :help mouse-using
. If I understand correctly your use case shouldn't work for some terminals, such as xterm:
In an xterm, with the currently active mode included in the 'mouse' option,
normal mouse clicks are used by Vim, mouse clicks with the shift or ctrl key
pressed go to the xterm. With the currently active mode not included in
'mouse' all mouse clicks go to the xterm.
Note that what you are asking is explicitly discouraged in :help design-improved
:
- Use the keyboard as much as feasible. The mouse requires a third hand,
which we don't have. Many terminals don't have a mouse.
- When the mouse is used anyway, avoid the need to switch back to the
keyboard. Avoid mixing mouse and keyboard handling.
xterm
should work with mouse+Vim out of the box (most emulators behave likexterm
if youexport TERM=xterm
),urxvt
configured withURxvt*scrollTtyOutput: false
should work as well.