I want to map Ctrl
+ mouse click to a command:
nnoremap <C-???> :YcmCompleter GoTo<CR>
Is it possible to do that using nnoremap
? What symbol should I use for that?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityYou are looking for this which I found at the bottom of :h keycodes
:
nnoremap <C-LeftMouse> :echom 'Foo'<CR>
And according to :h <LeftMouse>
you also need to check that set mouse
contains a
or n
:h keycodes
and h:mouse-using
, but didn't find how to run command after mouse moved to new location, don't you know that? I.e. I ctrl+click some word, and vim move cursor to this word first and only then execute the command. Mouse mode is enabled in my .vimrc
: set mouse=a
This would work:
nnoremap <C-LeftMouse> <LeftMouse>:YcmCompleter GoTo<CR>
Add another <CR>
at the end to go to the first result