Add system clipboard support to Neovim
authorFredrik Fornwall <fredrik@fornwall.net>
Mon, 29 Feb 2016 08:17:25 +0000 (03:17 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Mon, 29 Feb 2016 08:17:25 +0000 (03:17 -0500)
Since termux doesn't support the X11 clipboard (i.e. tools like xclip or
xsel), this patch allows Neovim to use plugins that require a clipboard,
such as netrw.  Requires the termux-api package.

Patch by Matthew Klein:
https://github.com/termux/termux-packages/pull/141

packages/neovim/runtime-autoload-provider-clipboard.vim.patch [new file with mode: 0644]

diff --git a/packages/neovim/runtime-autoload-provider-clipboard.vim.patch b/packages/neovim/runtime-autoload-provider-clipboard.vim.patch
new file mode 100644 (file)
index 0000000..b91a6db
--- /dev/null
@@ -0,0 +1,14 @@
+--- ../neovim-master/runtime/autoload/provider/clipboard.vim   2016-02-17 20:56:48.362733600 -0600
++++ ./runtime/autoload/provider/clipboard.vim  2016-02-17 20:56:23.022486500 -0600
+@@ -47,6 +47,11 @@
+   let s:paste['+'] = 'xclip -o -selection clipboard'
+   let s:copy['*'] = 'xclip -quiet -i -selection primary'
+   let s:paste['*'] = 'xclip -o -selection primary'
++elseif executable('termux-clipboard-set')
++  let s:copy['+'] = 'termux-clipboard-set'
++  let s:paste['+'] = 'termux-clipboard-get'
++  let s:copy['*'] = 'termux-clipboard-set'
++  let s:paste['*'] = 'termux-clipboard-get'
+ else
+   echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
+   finish