Vim supertab and jedi-vim

怎甘沉沦 提交于 2019-12-23 10:56:35

问题


Posting as a follow up to How to check if SuperTab and jedi-vim is activated? and have done what Ingo Karkat proposed. Now I wonder what is broken and how I fix it.

Here is the output:

:verbose imap <tab>
i  <Tab>         <Plug>SuperTabForward
    Last set from ~/.vim/bundle/supertab/plugin/supertab.vim

Which looks allright to me, and...

:scriptnames
  1: /etc/vimrc
  2: /usr/share/vim/vim72/syntax/syntax.vim
  3: /usr/share/vim/vim72/syntax/synload.vim
  4: /usr/share/vim/vim72/syntax/syncolor.vim
  5: /usr/share/vim/vim72/filetype.vim
  6: /usr/share/vim/vimfiles/ftdetect/puppet.vim
  7: /usr/share/vim/vim72/ftplugin.vim
  8: /home/johannesw/.vimrc
  9: /usr/share/vim/vim72/ftoff.vim
 10: /home/johannesw/.vim/bundle/vundle/autoload/vundle.vim
 11: /home/johannesw/.vim/bundle/vundle/autoload/vundle/config.vim
 12: /usr/share/vim/vim72/indent.vim
 13: /usr/share/vim/vim72/syntax/nosyntax.vim
 14: /home/johannesw/.vim/bundle/vim-fugitive/plugin/fugitive.vim
 15: /home/johannesw/.vim/bundle/vim-easymotion/plugin/EasyMotion.vim
 16: /home/johannesw/.vim/bundle/vim-easymotion/autoload/EasyMotion.vim
 17: /home/johannesw/.vim/bundle/vim-rails/plugin/rails.vim
 18: /home/johannesw/.vim/bundle/L9/plugin/l9.vim
 19: /home/johannesw/.vim/bundle/L9/autoload/l9.vim
 20: /home/johannesw/.vim/bundle/FuzzyFinder/plugin/fuf.vim
 21: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf.vim
 22: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/buffer.vim
 23: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/file.vim
 24: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/coveragefile.vim
 25: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/dir.vim
 26: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/bookmarkfile.vim
 27: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/bookmarkdir.vim
 28: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/tag.vim
 29: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/buffertag.vim
 30: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/taggedfile.vim
 31: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/jumplist.vim
 32: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/changelist.vim
 33: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/quickfix.vim
 34: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/line.vim
 35: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/help.vim
 36: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/givenfile.vim
 37: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/givendir.vim
 38: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/givencmd.vim
 39: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/callbackfile.vim
 40: /home/johannesw/.vim/bundle/FuzzyFinder/autoload/fuf/callbackitem.vim
 41: /home/johannesw/.vim/bundle/command-t/plugin/command-t.vim
 42: /home/johannesw/.vim/bundle/supertab/plugin/supertab.vim
 43: /home/johannesw/.vim/bundle/jedi-vim/plugin/jedi.vim
 44: /home/johannesw/.vim/bundle/jedi-vim/autoload/jedi.vim
 45: /usr/share/vim/vim72/plugin/filetype.vim
 46: /usr/share/vim/vim72/plugin/getscriptPlugin.vim
 47: /usr/share/vim/vim72/plugin/gzip.vim
 48: /usr/share/vim/vim72/plugin/matchparen.vim
 49: /usr/share/vim/vim72/plugin/netrwPlugin.vim
 50: /usr/share/vim/vim72/plugin/rrhelper.vim
 51: /usr/share/vim/vim72/plugin/spellfile.vim
 52: /usr/share/vim/vim72/plugin/tarPlugin.vim
 53: /usr/share/vim/vim72/plugin/tohtml.vim
 54: /usr/share/vim/vim72/plugin/vimballPlugin.vim
 55: /usr/share/vim/vim72/plugin/zipPlugin.vim
 56: /home/johannesw/.vim/bundle/vim-flake8/ftplugin/python_flake8.vim
 57: /home/johannesw/.vim/bundle/jedi-vim/ftplugin/python/jedi.vim
 58: /usr/share/vim/vim72/ftplugin/python.vim
 59: /usr/share/vim/vim72/indent/python.vim
 60: /usr/share/vim/vim72/syntax/python.vim
 61: /home/johannesw/.vim/bundle/jedi-vim/after/syntax/python.vim
 62: /home/johannesw/.vimrc.python

Looks fine, aswell. However (don't know if you should be able to do this, but)

:SuperTabForward
E492: Not an editor command: SuperTabForward

Feels less OK. Here is my .vimrc:

    " --- 8< --- https://github.com/gmarik/vundle 
set nocompatible               " be iMproved
filetype off                   " required!

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" let Vundle manage Vundle
" required! 
Bundle 'gmarik/vundle'

" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'
" ...

filetype plugin indent on     " required!
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..


" own stuff below

""" More Bundles
Bundle 'nvie/vim-flake8'
Bundle 'ervandew/supertab'
Bundle 'davidhalter/jedi-vim'

let mapleader=" "
set number
set paste
set foldmethod=indent
set foldlevel=99
set tabstop=4
set backupdir=~/.vim/backup
set directory=~/.vim/backup
set history=1000
set wildmode=list:longest
set ruler
" set completeopt=menuone,longest,preview
set completeopt=menuone,longest,preview
syntax on                           " syntax highlighing
"terminal title
set title
" searching
set ignorecase
set smartcase
" scrolling margin
set scrolloff=3
" Intuitive backspacing in insert mode
set backspace=indent,eol,start
" Highlight search terms...
set hlsearch
" ...dynamically as they are typed.
set incsearch

" Vertical Split : Ctrl+w + v  Horizontal Split: Ctrl+w + s
" Close current windows: Ctrl+w + q

" move about splits
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
    if !exists("autocommands_loaded")
  let autocommands_loaded = 1
  autocmd BufRead,BufNewFile,FileReadPost *.py source ~/.vimrc.python
endif

""" ack for searching
nmap <leader>a <Esc>:Ack!

""" keymappings
let g:SuperTabMappingForward = '<tab>'

and my ~/.vimrc.python

set tw=78 ts=4 sw=4 sta et sts=4 ai

" More syntax highlighting.
let python_highlight_all = 1

" Smart indenting
set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class

highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/

""" python/supertab
au FileType python set omnifunc=pythoncomplete#Complete
let g:SuperTabDefaultCompletionType = "context"
set completeopt=menuone,longest,preview

""" python/rope
map <leader>j :RopeGotoDefinition<CR>
map <leader>r :RopeRename<CR>

let g:jedi#popup_on_dot = 1
let g:jedi#use_tabs_not_buffers = 1

... and this is the output of "vim --version":

    VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr  5 2012 10:17:30)
Included patches: 1-411
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent 
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic 
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path 
+float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand 
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap 
+menu +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm 
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte 
+multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl +postscript 
+printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind 
+signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax 
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse 
+textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual 
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup 
-X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save 
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall  -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -D_FORTIFY_SOURCE=1    -D_REENTRANT -D_GNU_SOURCE  -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib64/perl5/CORE  -I/usr/include/python2.6 -pthread    
Linking: gcc   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE   -L/usr/local/lib -o vim       -lselinux  -lncurses -lacl -lgpm   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE  -fstack-protector  -L/usr/lib64/perl5/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.6/config -lpython2.6 -lutil -lm -Xlinker -export-dynamic

回答1:


I suspect this line: au FileType python set omnifunc=pythoncomplete#Complete

just remove it from your vimrc.

If this doesn't help please post the output of :set omnifunc.

Also I suggest to remove Rope. I don't know if it plays well together with Jedi, at least the keymappings are overlapping.



来源:https://stackoverflow.com/questions/13193768/vim-supertab-and-jedi-vim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!