mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
clipboard: Check $DISPLAY. Prefer xsel. #4150
This commit is contained in:
parent
add02b675d
commit
46bd3c0f77
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user