clipboard: Check $DISPLAY. Prefer xsel. #4150

This commit is contained in:
Shougo Matsushita 2016-02-02 22:14:59 +09:00 committed by Justin M. Keyes
parent add02b675d
commit 46bd3c0f77

View File

@ -37,16 +37,16 @@ if executable('pbcopy')
let s:copy['*'] = s:copy['+'] let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+'] let s:paste['*'] = s:paste['+']
let s:cache_enabled = 0 let s:cache_enabled = 0
elseif executable('xclip') elseif exists('$DISPLAY') && executable('xsel')
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')
let s:copy['+'] = 'xsel --nodetach -i -b' let s:copy['+'] = 'xsel --nodetach -i -b'
let s:paste['+'] = 'xsel -o -b' let s:paste['+'] = 'xsel -o -b'
let s:copy['*'] = 'xsel --nodetach -i -p' let s:copy['*'] = 'xsel --nodetach -i -p'
let s:paste['*'] = 'xsel -o -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 else
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard' echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
finish finish