【发布时间】:2021-04-30 19:30:19
【问题描述】:
我正在尝试为 python 编程配置 neovim。我找到了this article,关于如何将 qt-console 连接到以 neovim 作为编辑器的 python 脚本,我可以要求的一切。
我按照步骤操作,我的init.vim 看起来像这样
call plug#begin()
Plug 'bfredl/nvim-ipy'
call plug#end()
command! -nargs=0 RunQtConsole
\call jobstart("jupyter qtconsole --JupyterWidget.include_other_output=True")
let g:ipy_celldef = '^##' " regex for cell start and end
nmap <silent> <leader>jqt :RunQtConsole<Enter>
nmap <silent> <leader>jk :IPython<Space>--existing<Space>--no-window<Enter>
nmap <silent> <leader>jc <Plug>(IPy-RunCell)
nmap <silent> <leader>ja <Plug>(IPy-RunAll)
另外,我的ftplugin/python.vim 看起来像这样
setlocal tabstop=4
setlocal shiftwidth=4
setlocal expandtab
setlocal autoindent
但使用<leader>jqt 会出现以下错误
E492: not an editor command:jobstart("jupyter qtconsole --JupyterWidget.include_other_output=True")
我的猜测是这是因为RunQtConsole 假设您已经激活并设置了安装 jupyter 的环境。所以我尝试在 python 环境中启动 nvim,但结果是一样的。
后来,我尝试从 nvim 终端(然后是 RunQtCOnsole)执行环境激活,但不知道如何执行此操作。
我不确定我错过了什么。
【问题讨论】:
标签: python jupyter conda neovim