DEV Community

Cui Mingda
Cui Mingda

Posted on

2 2

How to config python provider for neovim

先确认Python2和Python3的执行路径:

which python
# /usr/bin/python

which python3
# /usr/bin/python
Enter fullscreen mode Exit fullscreen mode

修改~/.config/nvim/init.vim,增加python运行路径的设置

let g:python_host_prog = '/usr/bin/python'
let g:python3_host_prog = '/usr/bin/python3'
Enter fullscreen mode Exit fullscreen mode

安装Python2的provider

python -m pip install pynvim --user
Enter fullscreen mode Exit fullscreen mode

安装Python3的provider

python3 -m pip install pynvim --user
Enter fullscreen mode Exit fullscreen mode

如果提示pip需要升级,我们就升级一下

python3 -m pip install --upgrade pip --user
Enter fullscreen mode Exit fullscreen mode

最后,打开nvim,运行:checkhealth检查一下,可以看到成功配置的信息:

## Python 2 provider (optional)
  - INFO: Using: g:python_host_prog = "/usr/bin/python"
  - INFO: Executable: /usr/bin/python
  - INFO: Python version: 2.7.16
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "/usr/bin/python3"
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.8.2
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.
Enter fullscreen mode Exit fullscreen mode

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more