5

I'd like to remap a modified click in gvim (and also MacVim), but certain combinations of modifiers work while others do not. In gvim on a Linux box, I would like to insert "hello" anywhere I type:

:noremap <C-S-LeftMouse> <LeftMouse>ihello<ESC>

However, that command does not work: control-shift-click retains its original behavior. Yet I can remap control-click in gvim:

:noremap <C-LeftMouse> <LeftMouse>ihello<ESC>

In MacVim, command-shift-click <D-S-LeftMouse> is likewise unresponsive, as are most other modified clicks.

How can I actually remap the modified mouse clicks?

Seth Johnson
  • 14,762
  • 6
  • 59
  • 85

2 Answers2

4

To remap the <C-LeftMouse> in MacVim, you should first disable the contextual menu:

defaults write org.vim.MacVim MMTranslateCtrlClick 0
2

Double modifier keys don't work in MacVim. It's a known limitation/bug.

:nnoremap <M-LeftMouse> <LeftMouse>ihello<Esc>

seems to work, though, but neither <C-LeftMouse> nor <D-LeftMouse> do.

<C-LeftMouse> brings the normal contextual menu everyone expects, I wouldn't count on it being easily changed.

<D-LeftMouse> does nothing at all. I wonder if it's even registered.

romainl
  • 186,200
  • 21
  • 280
  • 313