Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping mouse events in vim through putty not working

Tags:

vim

map

mouse

xterm

I'm using Vim 6.3.81 on a x-term through putty. I wanted to map mouse events (like wheel-button click , double click) to specific events using my .vimrc . I've looked at the vim wiki and based on it, defined the following map in my .vimrc:

:nnoremap <2-LeftMouse> :set invnumber<CR>

However , it is not working - double-click is not toggling the line numbers as intended . Do I have to change my X settings to get vim to accept mouse events ?

Thanks...

like image 602
TCSGrad Avatar asked Dec 08 '09 08:12

TCSGrad


1 Answers

Have you issued a :set mouse=a or similar?

Vim can accept mouse input through the terminal, but it needs to be explicitly enabled. Both PuTTY and xTerm support it.

:help mouse for more details.

like image 131
Andrew Aylett Avatar answered Nov 06 '22 16:11

Andrew Aylett