diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-02-02 22:14:59 +0900 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-02-05 09:51:56 -0500 |
commit | 46bd3c0f77f282b93ca1307c011562243c394306 (patch) | |
tree | fb0fb1b314d2971532ad7e39e37f9acdfa7571e6 | |
parent | add02b675d4e974a971d4403e1e2ad20a7f78938 (diff) | |
download | rneovim-46bd3c0f77f282b93ca1307c011562243c394306.tar.gz rneovim-46bd3c0f77f282b93ca1307c011562243c394306.tar.bz2 rneovim-46bd3c0f77f282b93ca1307c011562243c394306.zip |
clipboard: Check $DISPLAY. Prefer xsel. #4150
-rw-r--r-- | runtime/autoload/provider/clipboard.vim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 3728eb9367..5ea9df92fe 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -37,16 +37,16 @@ if executable('pbcopy') let s:copy['*'] = s:copy['+'] let s:paste['*'] = s:paste['+'] let s:cache_enabled = 0 -elseif executable('xclip') - let s:copy['+'] = 'xclip -quiet -i -selection clipboard' - let s:paste['+'] = 'xclip -o -selection clipboard' - let s:copy['*'] = 'xclip -quiet -i -selection primary' - let s:paste['*'] = 'xclip -o -selection primary' -elseif executable('xsel') +elseif exists('$DISPLAY') && executable('xsel') let s:copy['+'] = 'xsel --nodetach -i -b' let s:paste['+'] = 'xsel -o -b' let s:copy['*'] = 'xsel --nodetach -i -p' let s:paste['*'] = 'xsel -o -p' +elseif exists('$DISPLAY') && executable('xclip') + let s:copy['+'] = 'xclip -quiet -i -selection clipboard' + let s:paste['+'] = 'xclip -o -selection clipboard' + let s:copy['*'] = 'xclip -quiet -i -selection primary' + let s:paste['*'] = 'xclip -o -selection primary' else echom 'clipboard: No clipboard tool available. See :help nvim-clipboard' finish |