Xinqi Bao's Git

vimrc: improve clipboard setting
authorXinqi Bao <[email protected]>
Sat, 23 May 2020 03:40:58 +0000 (23:40 -0400)
committerXinqi Bao <[email protected]>
Sat, 23 May 2020 03:40:58 +0000 (23:40 -0400)
.vimrc

diff --git a/.vimrc b/.vimrc
index c949e2c..1b4aaa8 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -36,8 +36,13 @@ set tags=tags~;,tags~
 "setting gf (go file) path
 set path+=/usr/include/c++/*,include;,includes;,lib;
 
 "setting gf (go file) path
 set path+=/usr/include/c++/*,include;,includes;,lib;
 
-" Using "+ register for all the yank and paste in vim
-set clipboard=unnamedplus
+" Writes to the unnamed register also writes to the * and + registers. This
+" makes it easy to interact with the system clipboard
+if has ('unnamedplus')
+    set clipboard=unnamedplus
+else
+    set clipboard=unnamed
+endif
 
 call plug#begin()
 
 
 call plug#begin()