Can't get the jedi-vim plugin to work
我正在尝试使用jedi-vim插件进行Python自动补全,但是我无法使其正常工作。
我有Vim 7.3,这是我所做的:
1-从
克隆代码
1 | git clone http://github.com/davidhalter/jedi-vim path/to/bundles/jedi-vim |
2-将
3-将
现在当我打开vim时,进入插入模式并键入
1 2 | import wave wave. |
什么都没有发生,尽管文档指定了
1 2 | E29: No inserted text yet Press ENTER or type command to continue |
我检查了
1 2 3 4 5 6 | n [m *@:call <SNR>21_Python_jump('?^\\s*\\(class\\|def\\)')<CR> n [[ *@:call <SNR>21_Python_jump('?^\\(class\\|def\\)')<CR> n ]m *@:call <SNR>21_Python_jump('/^\\s*\\(class\\|def\\)')<CR> n ]] *@:call <SNR>21_Python_jump('/^\\(class\\|def\\)')<CR> n gx <Plug>NetrwBrowseX n <Plug>NetrwBrowseX * :call netrw#NetrwBrowseX(expand("<cWORD>"),0)<CR> |
由于使用
我想念什么?
编辑
:脚本名称
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 1: /usr/share/vim/vimrc 2: /usr/share/vim/vim73/debian.vim 3: /usr/share/vim/vim73/syntax/syntax.vim 4: /usr/share/vim/vim73/syntax/synload.vim 5: /usr/share/vim/vim73/syntax/syncolor.vim 6: /usr/share/vim/vim73/filetype.vim 7: ~/.vimrc 8: ~/.vim/plugin/jedi.vim 9: /usr/share/vim/vim73/ftplugin.vim 10: /usr/share/vim/vim73/plugin/getscriptPlugin.vim 11: /usr/share/vim/vim73/plugin/gzip.vim 12: /usr/share/vim/vim73/plugin/matchparen.vim 13: /usr/share/vim/vim73/plugin/netrwPlugin.vim 14: /usr/share/vim/vim73/plugin/rrhelper.vim 15: /usr/share/vim/vim73/plugin/spellfile.vim 16: /usr/share/vim/vim73/plugin/tarPlugin.vim 17: /usr/share/vim/vim73/plugin/tohtml.vim 18: /usr/share/vim/vim73/plugin/vimballPlugin.vim 19: /usr/share/vim/vim73/plugin/zipPlugin.vim 20: /usr/share/vim/vim73/syntax/vim.vim 21: /usr/share/vim/vim73/syntax/python.vim 22: /usr/share/vim/vim73/ftplugin/vim.vim |
编辑2
我已将Vim更新为7.4,并按照doc中所述使用
1-安装绝地武士
2-安装病原体
3-在我的
4-克隆
中的git存储库
我创建了一个新文件,但是我仍然没有自动补全功能。例如:
1 2 | import numpy as np np. |
,插入模式下的控制空间返回:
1 | -- Omni completion (^O^N^P) Pattern not found |
是否有任何
我的
这是Jedi with Pathogen的基本安装。
安装病原体
1 2 | mkdir -p ~/.vim/autoload ~/.vim/bundle && \\ curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim |
配置
1 | execute pathogen#infect() |
其他:在您的主文件夹中创建一个名为
1 2 3 | execute pathogen#infect() syntax on filetype plugin indent on |
安装Jedi。
1 | cd ~/.vim/bundle/ && git clone --recursive https://github.com/davidhalter/jedi-vim.git |
我有一个类似的错误,因为我打算使用的python版本与被调用的版本不匹配。
确保jedi使用的是预期的python版本。例如。添加
如果您有
1 | set paste |
.vimrc文件中的jedi将无法运行。
我认为问题是您的vim版本太低,建议您更新到vim 7.4并确保它已打开python函数,如果您想要自动完成功能,建议您尝试"完成我",这是更多强大,需要Vim 7.3.584,现在vim 7.4已经发布,易于安装,可以通过这种方式安装,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/bin/bash MyInstallDir="/root/MyVim74Install/" cd ~ mkdir MyVim74Install if [ -d $MyInstallDir ]; then echo"create MyInstallDir success" else echo"create MyInstallDir Error" fi cd $MyInstallDir pwd wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz tar -zxvf ncurses-5.9.tar.gz cd ncurses-5.9 ./configure make make install make clean cd ~ cd $MyInstallDir wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz tar xzvf cmake-2.8.7.tar.gz cd cmake-2.8.7 ./bootstrap make make install wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 tar -jxvf vim-7.4.tar.bz2 cd vim74 ./configure --enable-gui=gtk2 --enable-cscope --enable-multibyte --enable-xim --enable-fontset \\ --with-features=huge --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config make make install make clean git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle apt-get install gcc apt-get install g++ wget http://prdownloads.sourceforge.net/ctags/ctags-5.6.tar.gz tar -zxvf ctags-5.6.tar.gz cd ctags-5.6 ./configure &&make &&make install ctags -R |
我安装了带有病原体的
编辑:回复下面的评论:我通过使用病原体重新安装jedi-vim来工作,而不是从源头安装它。这解决了我的问题,因此我认为这是一个答案。