(Neo)vim python支持和活动virtualenv-confi

2024-09-28 16:58:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我通常在Neovim下支持Python

init.vim

" Plug 'plytophogy/vim-virtualenv'

 if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
 else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
 endif
 Plug 'zchee/deoplete-jedi'
 Plug 'davidhalter/jedi-vim'

当我在某个虚拟环境处于活动状态时启动nvim,它以以下错误消息开头

^{pr2}$

当然,还有很多。在

我个人并不感到惊讶。插件的Python代码不应该在与之无关的虚拟环境中运行。但我必须这么做。我能做什么?在

vim-virtualenv显然与这个问题没有任何关系。也没有解决这个问题。在


Tags: ifvirtualenvinitvimdoplughasjedi
1条回答
网友
1楼 · 发布于 2024-09-28 16:58:30

有关Neovim提供程序,请参阅此documentation

PYTHON PROVIDER CONFIGURATION ~
                        *g:python_host_prog*
Command to start Python 2 (executable, not directory). Setting this makes
startup faster. Useful for working with virtualenvs.  >
    let g:python_host_prog  = '/path/to/python'
<
                        *g:python3_host_prog*
Command to start Python 3 (executable, not directory). Setting this makes
startup faster. Useful for working with virtualenvs.  >
    let g:python3_host_prog = '/path/to/python3'

相关问题 更多 >