gvim中把插件的双击改成单击

来源:互联网 发布:罗志祥stage淘宝店铺 编辑:程序博客网 时间:2024/05/21 12:41

 

首先搜索leftmouse 找到双击的map 注释掉

然后添加下面的脚本

        " Contributed by Bindu Wavell

        " attempt to perform single click mapping, it would be much

        " nicer if we could nnoremap <buffer> ... however vim does

        " not fire the <buffer> <leftmouse> when you use the mouse

        " to enter a buffer.

        let clickmap = ':if bufname("%") =~ "__Tag_List__" <bar> ' .

                    / 'call <SID>Tlist_Window_Jump_To_Tag("useopen") ' .

                    / '<bar> endif <CR>'     

        if maparg('<leftmouse>', 'n') == ''

            " no mapping for leftmouse

            exe ':nnoremap <silent> <leftmouse> <leftmouse>' . clickmap

        else

            " we have a mapping

            let mapcmd = ':nnoremap <silent> <leftmouse> <leftmouse>'

            let mapcmd = mapcmd . substitute(substitute(

                        / maparg('<leftmouse>', 'n'), '|', '<bar>', 'g'),

                        / '/c^<leftmouse>', '', '')

            let mapcmd = mapcmd . clickmap

            exe mapcmd

        endif

以上摘自taglist.vim
把上面的clickmap改成原来map即可
原创粉丝点击