From 0c7f600d01a4ab380af917dd6f20421532629047 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 11 Dec 2018 09:19:51 +0100 Subject: [PATCH] Attempt to fix clipboard reset on vim exit --- vimrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vimrc b/vimrc index 8e1ead0..fc4685c 100644 --- a/vimrc +++ b/vimrc @@ -103,8 +103,16 @@ set timeoutlen=1200 if has('unnamedplus') " Allow copying to and from OS clipboard set clipboard=unnamedplus else + if has("unix") + autocmd VimLeave * call system("xsel -ib", getreg('*')) + end set clipboard=unnamed end +if has("unix") + autocmd VimLeave * call system( + \ 'echo -n '.shellescape(getreg('+')).' | xclip -selection clipboard' + \ ) +end " === GENERAL UTILITIES ===