From e4a3b3ce20fb6db3590b5065678e39817afe9083 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 14 Sep 2015 14:51:53 +0200 Subject: text insertion with middle click over ssh without -X works problem was set mouse=a, which is default but which needs a gui. GUI is only available when using ssh -X to connect and sometimes it causes trouble when using sudo. Deactivated mouse=a in console and replaced it with mouse=nh which will make the mouse working in help files as usual and in normal mode, but not in insert mode, where the console should handle mouse events. --- vimrc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vimrc b/vimrc index 4788809..5d3417b 100644 --- a/vimrc +++ b/vimrc @@ -121,13 +121,11 @@ if &t_Co > 2 set cursorline | " highlight currently selected line endif -if has('mouse') - set mouse=a -endif if has("gui_running") - set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like + set mouse=a | " use mouse in gui-mode (which is default) set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode + set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like set guitablabel=%t | " do not display full path as tabname set guioptions+=m | " menu bar set guioptions+=T | " toolbar @@ -142,11 +140,14 @@ else if &term =~? 'mlterm\|xterm\|screen' set t_Co=256 | " fixes incompatibilities with our color scheme endif + set mouse=nh | " limits mouse usage to normal mode and help files, so that middle click text insertion works in insert mode set title | " set the terminal caption set icon | " sets the terminal icon to vim set ttyfast | " modern terminals are all fast in a way "set titleold="vim ended" | " set terminal title after closing vim "set titlestring="VIM-CONSOLE" | " set window title + "if has('mouse') + "endif endif -- cgit v1.2.3