From 8f05c163a20874a1513782e21d1e4378e2966c77 Mon Sep 17 00:00:00 2001 From: jdhao Date: Wed, 13 May 2020 14:54:32 +0800 Subject: [PATCH] do not set clipboard when no provider is found When there is no clipboard provider but we set the `clipboard` option, using the `:yank` command will produce a warning message. We need to check if a clipboard provider exists before setting up the clipboard option, see also [this issue](https://github.com/neovim/neovim/issues/12305). --- options.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/options.vim b/options.vim index ac12914..fff2496 100644 --- a/options.vim +++ b/options.vim @@ -18,7 +18,9 @@ set updatetime=2000 " Clipboard settings, always use clipboard for all delete, yank, change, put " operation, see https://stackoverflow.com/q/30691466/6064933 -set clipboard+=unnamedplus +if !empty(provider#clipboard#Executable()) + set clipboard+=unnamedplus +endif " Disable creating swapfiles, see https://stackoverflow.com/q/821902/6064933 set noswapfile