aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-06-27 12:21:53 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-06-27 12:22:06 +0200
commit6016ac270f54fe8494ee7bedde109019edb709c5 (patch)
treeb8e56b7dc0a9d081bfc819a2abef3bde55216ddd
parent91749c06dcc7e5119be097238a6e20fe829c8cc8 (diff)
downloadrneovim-6016ac270f54fe8494ee7bedde109019edb709c5.tar.gz
rneovim-6016ac270f54fe8494ee7bedde109019edb709c5.tar.bz2
rneovim-6016ac270f54fe8494ee7bedde109019edb709c5.zip
provider/clipboard.vim: allow configuration #6030
Closes #6029
-rw-r--r--runtime/autoload/provider/clipboard.vim7
-rw-r--r--runtime/doc/provider.txt19
2 files changed, 25 insertions, 1 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index e15aa1f2bd..582895ae5e 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -47,7 +47,12 @@ function! provider#clipboard#Error() abort
endfunction
function! provider#clipboard#Executable() abort
- if has('mac') && executable('pbcopy')
+ if exists('g:clipboard')
+ let s:copy = g:clipboard.copy
+ let s:paste = g:clipboard.paste
+ let s:cache_enabled = g:clipboard.cache_enabled
+ return g:clipboard.name
+ elseif has('mac') && executable('pbcopy')
let s:copy['+'] = 'pbcopy'
let s:paste['+'] = 'pbpaste'
let s:copy['*'] = s:copy['+']
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 435646bd1c..113f4a478e 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -129,6 +129,25 @@ are found in your `$PATH`.
- lemonade (for SSH) https://github.com/pocke/lemonade
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
+If you would like to configure the provider: >
+ let g:clipboard = {
+ \ 'name': 'myClipboard',
+ \ 'copy': {
+ \ '+': 'copyCommand',
+ \ '*': 'copyCommand',
+ \ },
+ \ 'paste': {
+ \ '+': 'pasteCommand',
+ \ '*': 'pasteCommand',
+ \ },
+ \ 'cache_enabled': 1,
+ \ }
+
+If the cache is enabled, then when a selection is copied and the copy command
+is executed, neovim will cache this selection until the copy command process
+dies. Then, when pasting, if the copy command process has not died, the cached
+selection is returned instead of executing the paste command.
+
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
registers.