doc: emphasize that "python" means "python 2"

This commit is contained in:
Justin M. Keyes 2018-08-24 23:11:53 +02:00
parent b11f5aa119
commit b12c20e466
2 changed files with 39 additions and 40 deletions

View File

@ -118,7 +118,7 @@ Instead, put the Python command in a function and call that function:
Note that "EOF" must be at the start of the line. Note that "EOF" must be at the start of the line.
============================================================================== ==============================================================================
2. The vim module *python-vim* 2. The vim module *python-vim* *python2*
Python code gets all of its access to vim (with one exception - see Python code gets all of its access to vim (with one exception - see
|python-output| below) via the "vim" module. The vim module implements two |python-output| below) via the "vim" module. The vim module implements two

View File

@ -13,44 +13,44 @@ Nvim delegates some features to dynamic "providers".
============================================================================== ==============================================================================
Python integration *provider-python* Python integration *provider-python*
Nvim supports Python |remote-plugin|s and the Vim legacy |python-vim| and Nvim supports Python |remote-plugin|s and the Vim legacy |python2| and
|python3| interfaces (which are implemented as remote-plugins). |python3| interfaces (which are implemented as remote-plugins).
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not. Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
PYTHON QUICKSTART ~ PYTHON QUICKSTART ~
If you used a package manager to install Nvim, you might already have the Install the "neovim" Python package:
required "neovim" Python package. Run |:checkhealth| to verify.
To install the package with "pip": - Run |:checkhealth| to see if you already have the package (some package
managers install the "neovim" Python package with Nvim itself).
- For Python 2 plugins, make sure Python 2.7 is available in your $PATH, then - For Python 2 plugins, make sure Python 2.7 is available in your $PATH, then
install the "neovim" Python package systemwide: > install the package systemwide: >
sudo pip2 install --upgrade neovim sudo pip2 install --upgrade neovim
< < or for the current user: >
or for the current user: >
pip2 install --user --upgrade neovim pip2 install --user --upgrade neovim
< < If "pip2" is missing, try "pip".
- For Python 3 plugins, make sure Python 3.4+ is available in your $PATH, then
install the "neovim" Python package systemwide: >
sudo pip3 install --upgrade neovim
<
or for the current user: >
pip3 install --user --upgrade neovim
<
Note: "pip" may refer to Python 2 or Python 3, so the steps above mention
"pip2" and "pip3" explicitly. If one is missing, try "pip".
Note: The `--upgrade` flag ensures you have the latest version even if - For Python 3 plugins, make sure Python 3.4+ is available in your $PATH, then
a previous version was already installed. install the package systemwide: >
sudo pip3 install --upgrade neovim
< or for the current user: >
pip3 install --user --upgrade neovim
< If "pip3" is missing, try "pip".
- The `--upgrade` flag ensures you have the latest version even if a previous
version was already installed.
PYTHON PROVIDER CONFIGURATION ~ PYTHON PROVIDER CONFIGURATION ~
*g:python_host_prog* *g:python_host_prog*
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
<
*g:python3_host_prog* *g:python3_host_prog*
Program to use for evaluating Python code. Setting this makes startup faster. Path to Python 3 interpreter. Setting this makes startup faster. Also useful
Also useful for working with virtualenvs. > for working with virtualenvs. >
let g:python_host_prog = '/path/to/python' let g:python3_host_prog = '/path/to/python3' " Python 3
let g:python3_host_prog = '/path/to/python3'
< <
*g:loaded_python_provider* *g:loaded_python_provider*
To disable Python 2 support: > To disable Python 2 support: >
@ -62,21 +62,21 @@ To disable Python 3 support: >
PYTHON VIRTUALENVS ~ PYTHON VIRTUALENVS ~
If you plan to use per-project virtualenvs often, you should assign If you plan to use per-project virtualenvs often, you should assign one
a virtualenv for Neovim and hard-code the interpreter path via virtualenv for Neovim and hard-code the interpreter path via
|g:python_host_prog| (or |g:python3_host_prog|) so that the "neovim" python |g:python3_host_prog| (or |g:python_host_prog|) so that the "neovim" package
package is not required for each Environment. Example using pyenv: > is not required for each virtualenv.
Example using pyenv: >
pyenv install 3.4.4 pyenv install 3.4.4
pyenv virtualenv 3.4.4 py3neovim pyenv virtualenv 3.4.4 py3nvim
pyenv activate py3neovim pyenv activate py3nvim
pip install neovim pip install neovim
pyenv which python # Note the path pyenv which python # Note the path
The last command reports the interpreter path, add it to your init.vim: >
let g:python3_host_prog = '/path/to/py3nvim/bin/python'
The last command reports the interpreter path. Add it to your init.vim: > See also: https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim
let g:python3_host_prog = '/full/path/to/py3neovim/bin/python'
More information:
https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim
============================================================================== ==============================================================================
Ruby integration *provider-ruby* Ruby integration *provider-ruby*
@ -84,13 +84,13 @@ Ruby integration *provider-ruby*
Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface
(which is itself implemented as a Nvim remote-plugin). (which is itself implemented as a Nvim remote-plugin).
Run |:checkhealth| to see if your system is up-to-date.
RUBY QUICKSTART ~ RUBY QUICKSTART ~
To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: > To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
gem install neovim gem install neovim
Run |:checkhealth| to see if your system is up-to-date.
RUBY PROVIDER CONFIGURATION ~ RUBY PROVIDER CONFIGURATION ~
*g:loaded_ruby_provider* *g:loaded_ruby_provider*
To disable Ruby support: > To disable Ruby support: >
@ -103,11 +103,10 @@ avoid the need to install the "neovim" gem in every project.
To use an absolute path (e.g. to an rbenv installation): > 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' let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host'
<
To use the RVM "system" Ruby installation: > To use the RVM "system" Ruby installation: >
let g:ruby_host_prog = 'rvm system do neovim-ruby-host' let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
<
============================================================================== ==============================================================================
Node.js integration *provider-nodejs* Node.js integration *provider-nodejs*
@ -130,7 +129,7 @@ To disable Node.js support: >
Command to start the Node.js host. Setting this makes startup faster. Command to start the Node.js host. Setting this makes startup faster.
By default, Nvim searches for "neovim-node-host" using "npm root -g", which By default, Nvim searches for "neovim-node-host" using "npm root -g", which
can be slow. To avoid this, set g:node_host_prog to an absolute path: > can be slow. To avoid this, set g:node_host_prog to the host path: >
let g:node_host_prog = '/usr/local/bin/neovim-node-host' let g:node_host_prog = '/usr/local/bin/neovim-node-host'
< <
============================================================================== ==============================================================================