diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
commit | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch) | |
tree | d8c1843a95da5ea0bb4acc09f7e37843d9995c86 /runtime/doc/provider.txt | |
parent | 142d9041391780ac15b89886a54015fdc5c73995 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-userreg.tar.gz rneovim-userreg.tar.bz2 rneovim-userreg.zip |
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'runtime/doc/provider.txt')
-rw-r--r-- | runtime/doc/provider.txt | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt index 5375d971f0..b8182347f8 100644 --- a/runtime/doc/provider.txt +++ b/runtime/doc/provider.txt @@ -4,7 +4,7 @@ NVIM REFERENCE MANUAL by Thiago de Arruda -Providers *provider* +Providers *provider* Nvim delegates some features to dynamic "providers". This document describes the providers and how to install them. @@ -66,7 +66,7 @@ To disable Python 3 support: >vim PYTHON VIRTUALENVS ~ *python-virtualenv* If you plan to use per-project virtualenvs often, you should assign one -virtualenv for Neovim and hard-code the interpreter path via +virtualenv for Nvim and hard-code the interpreter path via |g:python3_host_prog| so that the "pynvim" package is not required for each virtualenv. @@ -82,7 +82,7 @@ The last command reports the interpreter path, add it to your init.vim: >vim See also: https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim ============================================================================== -Ruby integration *provider-ruby* +Ruby integration *provider-ruby* Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface (which is itself implemented as a Nvim remote-plugin). @@ -169,7 +169,7 @@ can be slow. To avoid this, set g:node_host_prog to the host path: >vim let g:node_host_prog = '/usr/local/bin/neovim-node-host' < ============================================================================== -Clipboard integration *provider-clipboard* *clipboard* +Clipboard integration *provider-clipboard* *clipboard* Nvim has no direct connection to the system clipboard. Instead it depends on a |provider| which transparently uses shell commands to communicate with the @@ -182,15 +182,15 @@ the "+" and/or "*" registers explicitly): >vim See 'clipboard' for details and options. *clipboard-tool* -The presence of a working clipboard tool implicitly enables the '+' and '*' +The presence of a working clipboard tool implicitly enables the '+' and "*" registers. Nvim looks for these clipboard tools, in order of priority: - |g:clipboard| - pbcopy, pbpaste (macOS) - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) - waycopy, waypaste (if $WAYLAND_DISPLAY is set) - - xclip (if $DISPLAY is set) - xsel (if $DISPLAY is set) + - xclip (if $DISPLAY is set) - lemonade (for SSH) https://github.com/pocke/lemonade - doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/ - win32yank (Windows) @@ -253,9 +253,50 @@ For Windows WSL, try this g:clipboard definition: \ }, \ 'cache_enabled': 0, \ } - +< + *clipboard-osc52* +Nvim bundles a clipboard provider that allows copying to the system clipboard +using OSC 52. OSC 52 is an Operating System Command control sequence that +writes the copied text to the terminal emulator. If the terminal emulator +supports OSC 52 then it will write the copied text into the system clipboard. + +Nvim will attempt to automatically determine if the host terminal emulator +supports the OSC 52 sequence and enable the OSC 52 clipboard provider if it +does as long as all of the following are true: + + • Nvim is running in the |TUI| + • |g:clipboard| is unset + • 'clipboard' is not set to "unnamed" or "unnamedplus" + • $SSH_TTY is set + +If any of the above conditions are not met then the OSC 52 clipboard provider +will not be used by default and Nvim will fall back to discovering a +|clipboard-tool| through the usual process. + +To force Nvim to use the OSC 52 provider you can use the following +|g:clipboard| definition: >lua + + vim.g.clipboard = { + name = 'OSC 52', + copy = { + ['+'] = require('vim.ui.clipboard.osc52').copy('+'), + ['*'] = require('vim.ui.clipboard.osc52').copy('*'), + }, + paste = { + ['+'] = require('vim.ui.clipboard.osc52').paste('+'), + ['*'] = require('vim.ui.clipboard.osc52').paste('*'), + }, + } +< +Note that not all terminal emulators support reading from the system clipboard +(and even for those that do, users should be aware of the security +implications), so using OSC 52 for pasting may not be possible (and not +necessary, because you can |paste| instead using your system paste function). +Users may need to configure their terminal emulator to allow reading from the +clipboard. +< ============================================================================== -Paste *provider-paste* *paste* +Paste *provider-paste* *paste* "Paste" is a separate concept from |clipboard|: paste means "dump a bunch of text to the editor", whereas clipboard provides features like |quote+| to get |