Thursday, April 28, 2011

Re: how to map 2-leftmouse to open file in netw

On Apr 28, 10:09 am, wei gao <njugao...@gmail.com> wrote:
> Hi,
>
> In netw file explorer, the click left mouse on the file/folder will open the
> file/folder. Is there any way to use doube click to open the file/folder?
> Left mouse is usually used to select the file/folder instead of open
> file/folder.
>

Two steps:
1. in .vimrc, add let g:netrw_mousemaps = 0 " disable single-click to
open file
2. in ~/.vim/after/ftplugin/netrw.vim or similar (mine is in ~/.vim/
after/ftplugin/netrw_maps.vim), put nmap <buffer> <2-leftmouse> <CR>

Note you must use nmap instead of nnoremap, since you are
intentionally triggering the <CR> mapping in NetRW.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: