-1

With gvim, I can map <C-LeftMouse>, but I can't with vim running inside a terminal emulator (konsole in my case).

I have reasons to think it's because the sequence Ctrl + CLICK is not sent/detected :

in insert mode, typing Ctrl + V, Ctrl + CLICK prints "" with gvim, but only "" with konsole.

how to make vim / neovim to recognize this (useful) combination ?

EDIT Note that I already set mouse=a in vim

hl037_
  • 3,520
  • 1
  • 27
  • 58

1 Answers1

0

in the terminal you have to enable the mouse:

set mouse=a

map <C-LeftMouse> :echo 'Hello Left'<CR>
map <C-RightMouse> :echo 'Hello Right'<CR>

see :help mouse

MarcoLucidi
  • 2,007
  • 1
  • 5
  • 8
  • I forgot to precise `mouse` is already set to `a`... – hl037_ Aug 18 '20 at 21:43
  • @hl037_ oops, I'm sorry, I assumed you missed that step. can you show the exact mapping that isn't working? have you tried with simple "hello world" like the one in the answer? than can you try running `vim --clean` (it will not read vimrc) and then type `:set mouse=a` and the mapping? lastly it may be that the combination is used by your terminal emulator and gets intercepted before it can reach vim. can you try with another mapping that involves the mouse but not Ctrl like `map :echo 'Hello LeftMouse'`? – MarcoLucidi Aug 19 '20 at 09:13
  • I think this is not a vim problem but a Konsole problem : in insert mode, when I hit , only "" is printed (in gvim, when I do the same, is rightly printed). – hl037_ Aug 21 '20 at 15:37