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
|
|
|
|
|
|
|
|
|
2016-06-14 22:20:08 -07:00
|
|
|
Providers *provider*
|
|
|
|
|
|
|
|
Nvim delegates some features to dynamic "providers".
|
|
|
|
|
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
|
|
|
==============================================================================
|
2016-06-14 22:53:00 -07:00
|
|
|
Python integration *provider-python*
|
|
|
|
|
2018-08-24 14:11:53 -07:00
|
|
|
Nvim supports Python |remote-plugin|s and the Vim legacy |python2| and
|
2018-06-12 00:18:25 -07:00
|
|
|
|python3| interfaces (which are implemented as remote-plugins).
|
2016-06-14 22:53:00 -07:00
|
|
|
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
|
|
|
|
|
|
|
|
PYTHON QUICKSTART ~
|
|
|
|
|
2018-08-24 14:11:53 -07:00
|
|
|
Install the "neovim" Python package:
|
2016-09-24 06:07:49 -07:00
|
|
|
|
2018-08-24 14:11:53 -07:00
|
|
|
- Run |:checkhealth| to see if you already have the package (some package
|
|
|
|
managers install the "neovim" Python package with Nvim itself).
|
2016-06-14 22:53:00 -07:00
|
|
|
|
2018-06-12 00:18:25 -07:00
|
|
|
- For Python 2 plugins, make sure Python 2.7 is available in your $PATH, then
|
2018-08-24 14:11:53 -07:00
|
|
|
install the package systemwide: >
|
2018-03-14 01:32:19 -07:00
|
|
|
sudo pip2 install --upgrade neovim
|
2018-08-24 14:11:53 -07:00
|
|
|
< or for the current user: >
|
2018-03-14 01:32:19 -07:00
|
|
|
pip2 install --user --upgrade neovim
|
2018-08-24 14:11:53 -07:00
|
|
|
< If "pip2" is missing, try "pip".
|
|
|
|
|
2018-06-12 00:18:25 -07:00
|
|
|
- For Python 3 plugins, make sure Python 3.4+ is available in your $PATH, then
|
2018-08-24 14:11:53 -07:00
|
|
|
install the package systemwide: >
|
2018-03-14 01:32:19 -07:00
|
|
|
sudo pip3 install --upgrade neovim
|
2018-08-24 14:11:53 -07:00
|
|
|
< or for the current user: >
|
2018-03-14 01:32:19 -07:00
|
|
|
pip3 install --user --upgrade neovim
|
2018-08-24 14:11:53 -07:00
|
|
|
< If "pip3" is missing, try "pip".
|
2017-12-27 11:30:23 -07:00
|
|
|
|
2018-08-24 14:11:53 -07:00
|
|
|
- The `--upgrade` flag ensures you have the latest version even if a previous
|
|
|
|
version was already installed.
|
2016-06-14 22:53:00 -07:00
|
|
|
|
|
|
|
PYTHON PROVIDER CONFIGURATION ~
|
|
|
|
*g:python_host_prog*
|
2018-08-24 14:11:53 -07:00
|
|
|
Path to Python 2 interpreter. Setting this makes startup faster. Also useful
|
|
|
|
for working with virtualenvs. >
|
|
|
|
let g:python_host_prog = '/path/to/python' " Python 2
|
|
|
|
<
|
2016-06-14 22:53:00 -07:00
|
|
|
*g:python3_host_prog*
|
2018-08-24 14:11:53 -07:00
|
|
|
Path to Python 3 interpreter. Setting this makes startup faster. Also useful
|
|
|
|
for working with virtualenvs. >
|
|
|
|
let g:python3_host_prog = '/path/to/python3' " Python 3
|
2016-06-14 22:53:00 -07:00
|
|
|
<
|
|
|
|
*g:loaded_python_provider*
|
|
|
|
To disable Python 2 support: >
|
|
|
|
let g:loaded_python_provider = 1
|
|
|
|
<
|
|
|
|
*g:loaded_python3_provider*
|
|
|
|
To disable Python 3 support: >
|
|
|
|
let g:loaded_python3_provider = 1
|
|
|
|
|
2017-02-17 02:24:09 -07:00
|
|
|
PYTHON VIRTUALENVS ~
|
|
|
|
|
2018-08-24 14:11:53 -07:00
|
|
|
If you plan to use per-project virtualenvs often, you should assign one
|
|
|
|
virtualenv for Neovim and hard-code the interpreter path via
|
|
|
|
|g:python3_host_prog| (or |g:python_host_prog|) so that the "neovim" package
|
|
|
|
is not required for each virtualenv.
|
|
|
|
|
|
|
|
Example using pyenv: >
|
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
|
2017-02-17 02:24:09 -07:00
|
|
|
pip install neovim
|
|
|
|
pyenv which python # Note the path
|
2018-08-24 14:11:53 -07:00
|
|
|
The last command reports the interpreter path, add it to your init.vim: >
|
|
|
|
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
|
|
|
|
|
|
|
==============================================================================
|
2016-07-02 21:51:33 -07:00
|
|
|
Ruby integration *provider-ruby*
|
|
|
|
|
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
|
|
|
|
|
|
|
RUBY QUICKSTART ~
|
|
|
|
|
2018-06-12 00:18:25 -07:00
|
|
|
To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
|
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.
|
|
|
|
|
2016-07-02 21:51:33 -07:00
|
|
|
RUBY PROVIDER CONFIGURATION ~
|
|
|
|
*g:loaded_ruby_provider*
|
|
|
|
To disable Ruby support: >
|
|
|
|
let g:loaded_ruby_provider = 1
|
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
|
|
|
|
|
|
|
To use an absolute path (e.g. to an rbenv installation): >
|
|
|
|
let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host'
|
|
|
|
|
|
|
|
To use the RVM "system" Ruby installation: >
|
|
|
|
let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
|
2018-08-24 14:11:53 -07:00
|
|
|
|
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/
|
|
|
|
|
|
|
|
NODEJS QUICKSTART~
|
|
|
|
|
2018-06-12 00:18:25 -07:00
|
|
|
To use javascript remote-plugins with Nvim, install the "neovim" npm package: >
|
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.
|
|
|
|
|
2018-03-14 01:32:19 -07:00
|
|
|
NODEJS PROVIDER CONFIGURATION~
|
|
|
|
*g:loaded_node_provider*
|
2018-06-12 00:18:25 -07:00
|
|
|
To disable Node.js support: >
|
2018-03-14 01:32:19 -07:00
|
|
|
:let g:loaded_node_provider = 1
|
|
|
|
<
|
|
|
|
*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
|
2018-08-24 14:11:53 -07:00
|
|
|
can be slow. To avoid this, set g:node_host_prog to the host path: >
|
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
|
|
|
==============================================================================
|
2016-06-14 22:53:00 -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
|
|
|
|
the '+' and/or '*' registers explicitly): >
|
|
|
|
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*
|
|
|
|
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)
|
2017-08-19 05:13:14 -07:00
|
|
|
- xsel (if $DISPLAY is set)
|
|
|
|
- xclip (if $DISPLAY is set)
|
2016-06-14 22:20:08 -07:00
|
|
|
- lemonade (for SSH) https://github.com/pocke/lemonade
|
|
|
|
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
|
2017-06-28 00:34:47 -07:00
|
|
|
- win32yank (Windows)
|
|
|
|
- tmux (if $TMUX is set)
|
2016-06-14 22:20:08 -07:00
|
|
|
|
2017-06-28 00:34:47 -07:00
|
|
|
*g:clipboard*
|
|
|
|
To configure a custom clipboard tool, set `g:clipboard` to a dictionary: >
|
2017-06-27 03:21:53 -07:00
|
|
|
let g:clipboard = {
|
|
|
|
\ 'name': 'myClipboard',
|
|
|
|
\ 'copy': {
|
2017-06-28 00:34:47 -07:00
|
|
|
\ '+': 'tmux load-buffer -',
|
|
|
|
\ '*': 'tmux load-buffer -',
|
2017-06-27 03:21:53 -07:00
|
|
|
\ },
|
|
|
|
\ 'paste': {
|
2017-06-28 00:34:47 -07:00
|
|
|
\ '+': 'tmux save-buffer -',
|
|
|
|
\ '*': 'tmux save-buffer -',
|
2017-06-27 03:21:53 -07:00
|
|
|
\ },
|
|
|
|
\ 'cache_enabled': 1,
|
|
|
|
\ }
|
|
|
|
|
2017-06-28 00:34:47 -07:00
|
|
|
If `cache_enabled` is |TRUE| then when a selection is copied, Nvim will cache
|
|
|
|
the selection until the copy command process dies. When pasting, if the copy
|
|
|
|
process has not died, the cached selection is applied.
|
2016-06-14 22:20:08 -07:00
|
|
|
|
|
|
|
==============================================================================
|
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:
|