From ec900d65831d11a9409bf2a622fe602df44dece6 Mon Sep 17 00:00:00 2001 From: Artem Sheremet Date: Fri, 9 Jun 2017 23:24:52 +0200 Subject: [PATCH] OSC-52 support for vim Copy into system clipboard of the terminal (ssh client) from vim on the server without X11. Magic! --- .vimrc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.vimrc b/.vimrc index d0b4041..68c4d98 100644 --- a/.vimrc +++ b/.vimrc @@ -67,9 +67,9 @@ set background=dark " When set to "dark", Vim will try to use colors that look set list " Display tabs and trailing spaces -"if has("mouse") -" set mouse=a " Enable the use of the mouse. -"endif +if has("mouse") + set mouse=a " Enable the use of the mouse. +endif if exists("+undofile") " Enable the persistent undo file(s) @@ -188,7 +188,17 @@ nmap call Amap("zp", "r !cat", 1) "setl noai nocin nosi inde= formatoptions-=c formatoptions-=r formatoptions-=o nonumber " This doesn't yank; it (un)prepares vim to do so. -call Amap("zy", "setl paste! number! list! NoShowMarks GitGutterToggle", 1) +"call Amap("zy", "setl paste! number! list! NoShowMarks GitGutterToggle", 1) + +"noremap y :w !printf "\e]52;c;$(base64 -w0)\a" +"noremap y :w !printf "\eP\e]52;c;$(base64 -w0)\a\e\\" + +" https://github.com/mobile-shell/mosh/issues/637 D'oh, really Mosh?! +" Well at least works with SecureShell + screen. +noremap y :w !printf " +\$([[ "${TERM/-*/}" == screen ]] && printf "\eP") +\\e]52;c;$(base64 -w0)\a +\$([[ "${TERM/-*/}" == screen ]] && printf "\e\\")" " custom filetypes au BufNewFile,BufRead *.fasm setf fasm