Debian vim滑鼠右鍵無法使用解決

Debian中通過終端使用vim,滑鼠無法使用右鍵的復制粘貼等功能,這是由於vim的一向默認配置導致,按照下面方法修改即可。

解決方法

 vi /usr/share/vim/vim*/defaults.vim
....
 80 if has('mouse')
 81   if &term =~ 'xterm'
 82     set mouse-=a
 83   else
 84     set mouse=nvi
 85   endif
 86 endif
...

說明

mouse 選型默認爲 a,相關說明如下:

The mouse can be enabled for different modes:
n Normal mode
v Visual mode
i Insert mode
c Command-line mode
h all previous modes when editing a help file
a all previous modes
r for |hit-enter| and |more-prompt| prompt
Normally you would enable the mouse in all four modes with:
:set mouse=a

When the mouse is not enabled, the GUI will still use the mouse for
modeless selection. This doesn't move the text cursor.