2017-03-21 09:08:19 -07:00
|
|
|
*provider.txt* Nvim
|
2014-11-17 08:45:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
NVIM REFERENCE MANUAL by Thiago de Arruda
|
|
|
|
|
|
|
|
|
2023-02-21 09:07:26 -07:00
|
|
|
Providers *provider*
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2018-12-11 16:17:27 -07:00
|
|
|
Nvim delegates some features to dynamic "providers". This document describes
|
|
|
|
the providers and how to install them.
|
|
|
|
*E319*
|
|
|
|
Use of a feature requiring a missing provider is an error: >
|
|
|
|
|
|
|
|
E319: No "foo" provider found. Run ":checkhealth provider"
|
|
|
|
|
|
|
|
Run the |:checkhealth| command, and review the sections below.
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2017-10-20 17:33:58 -07:00
|
|
|
Type |gO| to see the table of contents.
|
2017-05-01 08:09:29 -07:00
|
|
|
|
2016-06-14 22:20:08 -07:00
|
|
|
==============================================================================
|
2018-12-11 16:17:27 -07:00
|
|
|
Python integration *provider-python*
|
2016-06-14 22:53:00 -07:00
|
|
|
|
2022-01-28 07:42:19 -07:00
|
|
|
Nvim supports Python |remote-plugin|s and the Vim legacy |python3| and
|
|
|
|
|pythonx| interfaces (which are implemented as remote-plugins).
|
2019-01-10 17:20:15 -07:00
|
|
|
|
|
|
|
Note: Only the Vim 7.3 legacy interface is supported, not later features such
|
2022-01-28 07:42:19 -07:00
|
|
|
as |python-bindeval| (Vim 7.4); use the Nvim API instead. Python 2 is not
|
|
|
|
supported.
|
2016-06-14 22:53:00 -07:00
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
|
2016-06-14 22:53:00 -07:00
|
|
|
PYTHON QUICKSTART ~
|
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
To use Python plugins, you need the "pynvim" module. Run |:checkhealth| to see
|
|
|
|
if you already have it (some package managers install the module with Nvim
|
|
|
|
itself).
|
|
|
|
|
|
|
|
For Python 3 plugins:
|
|
|
|
1. Make sure Python 3.4+ is available in your $PATH.
|
2022-11-22 10:41:00 -07:00
|
|
|
2. Install the module (try "python" if "python3" is missing): >bash
|
2019-03-27 03:11:52 -07:00
|
|
|
python3 -m pip install --user --upgrade pynvim
|
2019-03-21 04:22:35 -07:00
|
|
|
|
|
|
|
The pip `--upgrade` flag ensures that you get the latest version even if
|
|
|
|
a previous version was already installed.
|
2016-06-14 22:53:00 -07:00
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
See also |python-virtualenv|.
|
2018-08-24 14:11:53 -07:00
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
Note: The old "neovim" module was renamed to "pynvim".
|
|
|
|
https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
|
2022-11-22 10:41:00 -07:00
|
|
|
If you run into problems, uninstall _both_ then install "pynvim" again: >bash
|
2019-03-27 03:11:52 -07:00
|
|
|
python -m pip uninstall neovim pynvim
|
|
|
|
python -m pip install --user --upgrade pynvim
|
2017-12-27 11:30:23 -07:00
|
|
|
|
2016-06-14 22:53:00 -07:00
|
|
|
|
|
|
|
PYTHON PROVIDER CONFIGURATION ~
|
|
|
|
*g:python3_host_prog*
|
2019-07-19 12:32:04 -07:00
|
|
|
Command to start Python 3 (executable, not directory). Setting this makes
|
2020-01-02 01:38:49 -07:00
|
|
|
startup faster. Useful for working with virtualenvs. Must be set before any
|
2022-11-22 10:41:00 -07:00
|
|
|
check for has("python3"). >vim
|
2019-07-19 12:32:04 -07:00
|
|
|
let g:python3_host_prog = '/path/to/python3'
|
2016-06-14 22:53:00 -07:00
|
|
|
<
|
|
|
|
*g:loaded_python3_provider*
|
2022-11-22 10:41:00 -07:00
|
|
|
To disable Python 3 support: >vim
|
2019-08-04 03:06:24 -07:00
|
|
|
let g:loaded_python3_provider = 0
|
2016-06-14 22:53:00 -07:00
|
|
|
|
2017-02-17 02:24:09 -07:00
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
PYTHON VIRTUALENVS ~
|
|
|
|
*python-virtualenv*
|
2018-08-24 14:11:53 -07:00
|
|
|
If you plan to use per-project virtualenvs often, you should assign one
|
2023-06-22 03:44:51 -07:00
|
|
|
virtualenv for Nvim and hard-code the interpreter path via
|
2022-01-28 07:42:19 -07:00
|
|
|
|g:python3_host_prog| so that the "pynvim" package is not required
|
|
|
|
for each virtualenv.
|
2018-08-24 14:11:53 -07:00
|
|
|
|
2022-11-22 10:41:00 -07:00
|
|
|
Example using pyenv: >bash
|
2017-02-17 02:24:09 -07:00
|
|
|
pyenv install 3.4.4
|
2018-08-24 14:11:53 -07:00
|
|
|
pyenv virtualenv 3.4.4 py3nvim
|
|
|
|
pyenv activate py3nvim
|
2021-04-14 11:48:13 -07:00
|
|
|
python3 -m pip install pynvim
|
2017-02-17 02:24:09 -07:00
|
|
|
pyenv which python # Note the path
|
2022-11-22 10:41:00 -07:00
|
|
|
The last command reports the interpreter path, add it to your init.vim: >vim
|
2018-08-24 14:11:53 -07:00
|
|
|
let g:python3_host_prog = '/path/to/py3nvim/bin/python'
|
2017-02-17 02:24:09 -07:00
|
|
|
|
2018-08-24 14:11:53 -07:00
|
|
|
See also: https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim
|
2016-06-14 22:53:00 -07:00
|
|
|
|
|
|
|
==============================================================================
|
2023-02-21 09:07:26 -07:00
|
|
|
Ruby integration *provider-ruby*
|
2016-07-02 21:51:33 -07:00
|
|
|
|
2018-06-12 00:18:25 -07:00
|
|
|
Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface
|
|
|
|
(which is itself implemented as a Nvim remote-plugin).
|
2016-07-02 21:51:33 -07:00
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
|
2016-07-02 21:51:33 -07:00
|
|
|
RUBY QUICKSTART ~
|
|
|
|
|
2022-11-22 10:41:00 -07:00
|
|
|
To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >bash
|
2018-03-14 01:32:19 -07:00
|
|
|
gem install neovim
|
2016-07-02 21:51:33 -07:00
|
|
|
|
2018-08-24 14:11:53 -07:00
|
|
|
Run |:checkhealth| to see if your system is up-to-date.
|
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
|
2016-07-02 21:51:33 -07:00
|
|
|
RUBY PROVIDER CONFIGURATION ~
|
|
|
|
*g:loaded_ruby_provider*
|
2022-11-22 10:41:00 -07:00
|
|
|
To disable Ruby support: >vim
|
2019-08-04 03:06:24 -07:00
|
|
|
let g:loaded_ruby_provider = 0
|
2017-06-17 08:56:17 -07:00
|
|
|
<
|
|
|
|
*g:ruby_host_prog*
|
2018-06-12 00:18:25 -07:00
|
|
|
Command to start the Ruby host. By default this is "neovim-ruby-host". With
|
|
|
|
project-local Ruby versions (via tools like RVM or rbenv) setting this can
|
|
|
|
avoid the need to install the "neovim" gem in every project.
|
2017-06-17 08:56:17 -07:00
|
|
|
|
2022-11-22 10:41:00 -07:00
|
|
|
To use an absolute path (e.g. to an rbenv installation): >vim
|
2017-06-17 08:56:17 -07:00
|
|
|
let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host'
|
|
|
|
|
2022-11-22 10:41:00 -07:00
|
|
|
To use the RVM "system" Ruby installation: >vim
|
2017-06-17 08:56:17 -07:00
|
|
|
let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
|
2018-08-24 14:11:53 -07:00
|
|
|
|
2020-01-18 08:59:17 -07:00
|
|
|
==============================================================================
|
|
|
|
Perl integration *provider-perl*
|
|
|
|
|
2020-08-30 06:43:12 -07:00
|
|
|
Nvim supports Perl |remote-plugin|s on Unix platforms. Support for polling STDIN
|
|
|
|
on MS-Windows is currently lacking from all known event loop implementations.
|
|
|
|
The Vim legacy |perl-vim| interface is also supported (which is itself
|
|
|
|
implemented as a Nvim remote-plugin).
|
2020-01-18 08:59:17 -07:00
|
|
|
https://github.com/jacquesg/p5-Neovim-Ext
|
|
|
|
|
2020-09-01 06:46:30 -07:00
|
|
|
Note: Only perl versions from 5.22 onward are supported.
|
2020-01-18 08:59:17 -07:00
|
|
|
|
|
|
|
PERL QUICKSTART~
|
|
|
|
|
2022-11-22 10:41:00 -07:00
|
|
|
To use perl remote-plugins with Nvim, install the "Neovim::Ext" cpan package: >bash
|
2020-01-18 08:59:17 -07:00
|
|
|
cpanm -n Neovim::Ext
|
|
|
|
|
|
|
|
Run |:checkhealth| to see if your system is up-to-date.
|
|
|
|
|
|
|
|
|
|
|
|
PERL PROVIDER CONFIGURATION~
|
|
|
|
*g:loaded_perl_provider*
|
2022-11-22 10:41:00 -07:00
|
|
|
To disable Perl support: >vim
|
2020-01-18 08:59:17 -07:00
|
|
|
:let g:loaded_perl_provider = 0
|
|
|
|
<
|
|
|
|
*g:perl_host_prog*
|
|
|
|
Command to start the Perl executable. Must be set before any
|
2022-11-22 10:41:00 -07:00
|
|
|
check for has("perl"). >vim
|
2020-01-18 08:59:17 -07:00
|
|
|
let g:perl_host_prog = '/path/to/perl'
|
|
|
|
<
|
2018-03-14 01:32:19 -07:00
|
|
|
==============================================================================
|
|
|
|
Node.js integration *provider-nodejs*
|
|
|
|
|
|
|
|
Nvim supports Node.js |remote-plugin|s.
|
|
|
|
https://github.com/neovim/node-client/
|
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
|
2018-03-14 01:32:19 -07:00
|
|
|
NODEJS QUICKSTART~
|
|
|
|
|
2022-11-22 10:41:00 -07:00
|
|
|
To use javascript remote-plugins with Nvim, install the "neovim" npm package: >bash
|
2018-03-14 01:32:19 -07:00
|
|
|
npm install -g neovim
|
2018-06-12 00:18:25 -07:00
|
|
|
|
|
|
|
Run |:checkhealth| to see if your system is up-to-date.
|
|
|
|
|
2019-03-21 04:22:35 -07:00
|
|
|
|
2018-03-14 01:32:19 -07:00
|
|
|
NODEJS PROVIDER CONFIGURATION~
|
|
|
|
*g:loaded_node_provider*
|
2022-11-22 10:41:00 -07:00
|
|
|
To disable Node.js support: >vim
|
2019-08-04 03:06:24 -07:00
|
|
|
:let g:loaded_node_provider = 0
|
2018-03-14 01:32:19 -07:00
|
|
|
<
|
|
|
|
*g:node_host_prog*
|
2018-06-12 00:18:25 -07:00
|
|
|
Command to start the Node.js host. Setting this makes startup faster.
|
2018-03-14 01:32:19 -07:00
|
|
|
|
2018-06-12 00:18:25 -07:00
|
|
|
By default, Nvim searches for "neovim-node-host" using "npm root -g", which
|
2022-11-22 10:41:00 -07:00
|
|
|
can be slow. To avoid this, set g:node_host_prog to the host path: >vim
|
2018-03-14 20:59:18 -07:00
|
|
|
let g:node_host_prog = '/usr/local/bin/neovim-node-host'
|
|
|
|
<
|
2016-07-02 21:51:33 -07:00
|
|
|
==============================================================================
|
2023-02-21 09:07:26 -07:00
|
|
|
Clipboard integration *provider-clipboard* *clipboard*
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2017-06-28 00:34:47 -07:00
|
|
|
Nvim has no direct connection to the system clipboard. Instead it depends on
|
|
|
|
a |provider| which transparently uses shell commands to communicate with the
|
|
|
|
system clipboard or any other clipboard "backend".
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2017-06-28 00:34:47 -07:00
|
|
|
To ALWAYS use the clipboard for ALL operations (instead of interacting with
|
2022-12-11 19:41:26 -07:00
|
|
|
the "+" and/or "*" registers explicitly): >vim
|
2017-06-28 00:34:47 -07:00
|
|
|
set clipboard+=unnamedplus
|
2018-06-12 00:18:25 -07:00
|
|
|
|
2017-06-28 00:34:47 -07:00
|
|
|
See 'clipboard' for details and options.
|
|
|
|
|
|
|
|
*clipboard-tool*
|
2023-05-13 12:33:22 -07:00
|
|
|
The presence of a working clipboard tool implicitly enables the '+' and "*"
|
2017-06-28 00:34:47 -07:00
|
|
|
registers. Nvim looks for these clipboard tools, in order of priority:
|
|
|
|
|
2024-03-29 07:43:26 -07:00
|
|
|
- |g:clipboard| (unless unset or `false`)
|
2018-12-01 10:50:26 -07:00
|
|
|
- pbcopy, pbpaste (macOS)
|
|
|
|
- wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
|
2022-11-18 08:39:56 -07:00
|
|
|
- waycopy, waypaste (if $WAYLAND_DISPLAY is set)
|
2018-12-01 10:50:26 -07:00
|
|
|
- xsel (if $DISPLAY is set)
|
2023-06-02 07:59:58 -07:00
|
|
|
- xclip (if $DISPLAY is set)
|
2016-06-14 22:20:08 -07:00
|
|
|
- lemonade (for SSH) https://github.com/pocke/lemonade
|
2022-10-14 08:01:13 -07:00
|
|
|
- doitclient (for SSH) https://www.chiark.greenend.org.uk/~sgtatham/doit/
|
2024-12-03 11:17:15 -07:00
|
|
|
- *win32yank* (Windows)
|
2024-09-02 05:43:23 -07:00
|
|
|
- putclip, getclip (Windows) https://cygwin.com/packages/summary/cygutils.html
|
|
|
|
- clip, powershell (Windows) https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/clip
|
2021-09-10 06:59:17 -07:00
|
|
|
- termux (via termux-clipboard-set, termux-clipboard-set)
|
2017-06-28 00:34:47 -07:00
|
|
|
- tmux (if $TMUX is set)
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2017-06-28 00:34:47 -07:00
|
|
|
*g:clipboard*
|
2018-12-01 08:30:50 -07:00
|
|
|
To configure a custom clipboard tool, set g:clipboard to a dictionary.
|
2022-11-22 10:41:00 -07:00
|
|
|
For example this configuration integrates the tmux clipboard: >vim
|
2018-12-01 08:30:50 -07:00
|
|
|
|
2017-06-27 03:21:53 -07:00
|
|
|
let g:clipboard = {
|
|
|
|
\ 'name': 'myClipboard',
|
|
|
|
\ 'copy': {
|
2020-09-01 00:27:38 -07:00
|
|
|
\ '+': ['tmux', 'load-buffer', '-'],
|
|
|
|
\ '*': ['tmux', 'load-buffer', '-'],
|
2017-06-27 03:21:53 -07:00
|
|
|
\ },
|
|
|
|
\ 'paste': {
|
2020-09-01 00:27:38 -07:00
|
|
|
\ '+': ['tmux', 'save-buffer', '-'],
|
|
|
|
\ '*': ['tmux', 'save-buffer', '-'],
|
2017-06-27 03:21:53 -07:00
|
|
|
\ },
|
|
|
|
\ 'cache_enabled': 1,
|
|
|
|
\ }
|
|
|
|
|
2018-12-01 08:30:50 -07:00
|
|
|
If "cache_enabled" is |TRUE| then when a selection is copied Nvim will cache
|
2017-06-28 00:34:47 -07:00
|
|
|
the selection until the copy command process dies. When pasting, if the copy
|
2018-12-01 08:30:50 -07:00
|
|
|
process has not died the cached selection is applied.
|
|
|
|
|
|
|
|
g:clipboard can also use functions (see |lambda|) instead of strings.
|
2022-11-22 10:41:00 -07:00
|
|
|
For example this configuration uses the g:foo variable as a fake clipboard:
|
|
|
|
>vim
|
2018-12-01 08:30:50 -07:00
|
|
|
|
|
|
|
let g:clipboard = {
|
|
|
|
\ 'name': 'myClipboard',
|
|
|
|
\ 'copy': {
|
|
|
|
\ '+': {lines, regtype -> extend(g:, {'foo': [lines, regtype]}) },
|
|
|
|
\ '*': {lines, regtype -> extend(g:, {'foo': [lines, regtype]}) },
|
|
|
|
\ },
|
|
|
|
\ 'paste': {
|
|
|
|
\ '+': {-> get(g:, 'foo', [])},
|
|
|
|
\ '*': {-> get(g:, 'foo', [])},
|
|
|
|
\ },
|
|
|
|
\ }
|
|
|
|
|
|
|
|
The "copy" function stores a list of lines and the register type. The "paste"
|
|
|
|
function returns the clipboard as a `[lines, regtype]` list, where `lines` is
|
|
|
|
a list of lines and `regtype` is a register type conforming to |setreg()|.
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2022-10-09 05:21:52 -07:00
|
|
|
*clipboard-wsl*
|
|
|
|
For Windows WSL, try this g:clipboard definition:
|
2022-11-22 10:41:00 -07:00
|
|
|
>vim
|
2022-10-09 05:21:52 -07:00
|
|
|
let g:clipboard = {
|
|
|
|
\ 'name': 'WslClipboard',
|
|
|
|
\ 'copy': {
|
|
|
|
\ '+': 'clip.exe',
|
|
|
|
\ '*': 'clip.exe',
|
|
|
|
\ },
|
|
|
|
\ 'paste': {
|
2024-09-01 13:01:24 -07:00
|
|
|
\ '+': 'powershell.exe -NoLogo -NoProfile -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
|
|
|
\ '*': 'powershell.exe -NoLogo -NoProfile -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
2022-10-09 05:21:52 -07:00
|
|
|
\ },
|
|
|
|
\ 'cache_enabled': 0,
|
|
|
|
\ }
|
2023-10-30 11:23:55 -07:00
|
|
|
<
|
|
|
|
*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.
|
|
|
|
|
2023-11-16 11:21:24 -07:00
|
|
|
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:
|
2023-10-30 11:23:55 -07:00
|
|
|
|
2023-11-16 11:21:24 -07:00
|
|
|
• 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
|
2023-10-30 11:23:55 -07:00
|
|
|
|
|
|
|
vim.g.clipboard = {
|
|
|
|
name = 'OSC 52',
|
|
|
|
copy = {
|
2023-11-16 11:21:24 -07:00
|
|
|
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
|
|
|
|
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
|
2023-10-30 11:23:55 -07:00
|
|
|
},
|
|
|
|
paste = {
|
2023-11-16 11:21:24 -07:00
|
|
|
['+'] = require('vim.ui.clipboard.osc52').paste('+'),
|
|
|
|
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
|
2023-10-30 11:23:55 -07:00
|
|
|
},
|
|
|
|
}
|
|
|
|
<
|
|
|
|
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
|
2023-11-16 11:21:24 -07:00
|
|
|
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.
|
2023-10-30 11:23:55 -07:00
|
|
|
<
|
2016-06-14 22:20:08 -07:00
|
|
|
==============================================================================
|
2023-02-21 09:07:26 -07:00
|
|
|
Paste *provider-paste* *paste*
|
2019-08-24 04:54:27 -07:00
|
|
|
|
|
|
|
"Paste" is a separate concept from |clipboard|: paste means "dump a bunch of
|
2022-09-25 16:58:27 -07:00
|
|
|
text to the editor", whereas clipboard provides features like |quote+| to get
|
2019-08-26 20:19:25 -07:00
|
|
|
and set the OS clipboard directly. For example, middle-click or CTRL-SHIFT-v
|
|
|
|
(macOS: CMD-v) in your terminal is "paste", not "clipboard": the terminal
|
|
|
|
application (Nvim) just gets a stream of text, it does not interact with the
|
|
|
|
clipboard directly.
|
2019-08-24 04:54:27 -07:00
|
|
|
|
|
|
|
*bracketed-paste-mode*
|
|
|
|
Pasting in the |TUI| depends on the "bracketed paste" terminal capability,
|
|
|
|
which allows terminal applications to distinguish between user input and
|
|
|
|
pasted text. https://cirw.in/blog/bracketed-paste
|
|
|
|
This works automatically if your terminal supports it.
|
|
|
|
|
|
|
|
*ui-paste*
|
2019-08-26 20:19:25 -07:00
|
|
|
GUIs can paste by calling |nvim_paste()|.
|
2019-08-24 04:54:27 -07:00
|
|
|
|
|
|
|
PASTE BEHAVIOR ~
|
|
|
|
|
2019-09-09 08:29:49 -07:00
|
|
|
Paste inserts text after the cursor. Lines break at <NL>, <CR>, and <CR><NL>.
|
2019-08-29 14:45:02 -07:00
|
|
|
When pasting a huge amount of text, screen-updates are throttled and the
|
2019-08-24 04:54:27 -07:00
|
|
|
message area shows a "..." pulse.
|
|
|
|
|
2019-08-29 14:45:02 -07:00
|
|
|
In cmdline-mode only the first line is pasted, to avoid accidentally executing
|
|
|
|
many commands. Use the |cmdline-window| if you really want to paste multiple
|
|
|
|
lines to the cmdline.
|
|
|
|
|
2019-08-26 20:19:25 -07:00
|
|
|
You can implement a custom paste handler by redefining |vim.paste()|.
|
2022-11-22 10:41:00 -07:00
|
|
|
Example: >lua
|
2019-08-24 04:54:27 -07:00
|
|
|
|
2019-08-26 20:19:25 -07:00
|
|
|
vim.paste = (function(lines, phase)
|
2019-08-24 04:54:27 -07:00
|
|
|
vim.api.nvim_put(lines, 'c', true, true)
|
|
|
|
end)
|
|
|
|
|
|
|
|
==============================================================================
|
2016-06-14 22:53:00 -07:00
|
|
|
X11 selection mechanism *clipboard-x11* *x11-selection*
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2017-08-19 05:13:14 -07:00
|
|
|
X11 clipboard providers store text in "selections". Selections are owned by an
|
|
|
|
application, so when the application gets closed, the selection text is lost.
|
2016-06-14 22:20:08 -07:00
|
|
|
The contents of selections are held by the originating application (e.g., upon
|
2017-08-19 05:13:14 -07:00
|
|
|
a copy), and only passed to another application when that other application
|
|
|
|
requests them (e.g., upon a paste).
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2018-09-21 05:59:02 -07:00
|
|
|
*primary-selection* *quotestar* *quoteplus* *quote+*
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2018-09-21 05:59:02 -07:00
|
|
|
There are three documented X11 selections: PRIMARY, SECONDARY, and CLIPBOARD.
|
|
|
|
CLIPBOARD is typically used in X11 applications for copy/paste operations
|
|
|
|
(CTRL-c/CTRL-v), while PRIMARY is used for the last selected text, which is
|
2016-06-14 22:20:08 -07:00
|
|
|
generally inserted with the middle mouse button.
|
|
|
|
|
2018-09-21 05:59:02 -07:00
|
|
|
Nvim's X11 clipboard providers only use the PRIMARY and CLIPBOARD selections,
|
|
|
|
for the "*" and "+" registers, respectively.
|
2014-11-17 08:45:52 -07:00
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
vim:tw=78:ts=8:noet:ft=help:norl:
|