From 74d555ce276032da3e01763bd2a6feff6c456f05 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 22 Jul 2017 14:33:04 +0300 Subject: [PATCH] .vimrc: Use xclip to copy/paste to/from X clipboard at remote host --- .vimrc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.vimrc b/.vimrc index 4b7fdf8..ea2fa79 100644 --- a/.vimrc +++ b/.vimrc @@ -237,13 +237,6 @@ else if (&term =~ "rxvt") || (&term =~ "screen") || (&term =~ "term") || (&term =~ "vt100") execute 'set t_kb=' . nr2char(127) - " 'autoselect' to always put selected text on the clipboard; - " 'unnamed' to use the * register like unnamed register '*' - " for all yank, delete and put operations; - " This allows to use mouse for copy/paste in local xterm, - " but prevents to save the unnamed register between sessions. - " set clipboard=autoselect,unnamed,exclude:cons\|linux - if has ("terminfo") " set t_Co=256 set t_Co=16 @@ -252,6 +245,18 @@ else set t_Sf="\e[3%dm" set t_Sb="\e[4%dm" endif + + " 'autoselect' to always put selected text on the clipboard; + " 'unnamed' to use the * register like unnamed register '*' + " for all yank, delete and put operations; + " This allows to use mouse for copy/paste in local xterm, + " but prevents to save the unnamed register between sessions. + " set clipboard=autoselect,unnamed,exclude:cons\|linux + + " Use xclip to copy/paste to/from X clipboard at remote host + " vmap "+y :!xclip -i -sel clip + " map "+p :r!xclip -o -sel clip + " Enable X11Forwarding and use ssh -X or even -Y endif if (&term =~ "screen") -- 2.39.5