aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/provider/clipboard.vim8
-rw-r--r--runtime/filetype.vim2
2 files changed, 8 insertions, 2 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 581cec036e..b8baaa8c64 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -33,6 +33,12 @@ function! s:try_cmd(cmd, ...)
return out
endfunction
+" Returns TRUE if `cmd` exits with success, else FALSE.
+function! s:cmd_ok(cmd)
+ call system(a:cmd)
+ return v:shell_error == 0
+endfunction
+
let s:cache_enabled = 1
let s:err = ''
@@ -48,7 +54,7 @@ function! provider#clipboard#Executable() abort
let s:paste['*'] = s:paste['+']
let s:cache_enabled = 0
return 'pbcopy'
- elseif exists('$DISPLAY') && executable('xsel')
+ elseif exists('$DISPLAY') && executable('xsel') && s:cmd_ok('xsel -o -b')
let s:copy['+'] = 'xsel --nodetach -i -b'
let s:paste['+'] = 'xsel -o -b'
let s:copy['*'] = 'xsel --nodetach -i -p'
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index e3447670f4..93886d5379 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1143,7 +1143,7 @@ au BufNewFile,BufRead *.ist,*.mst setf ist
au BufNewFile,BufRead *.page setf mallard
" Manpage
-au BufNewFile,BufRead *.man setf man
+au BufNewFile,BufRead *.man setf nroff
" Man config
au BufNewFile,BufRead */etc/man.conf,man.config setf manconf