本文介绍了Vim Supertab和jedi-vim的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发布有关后续操作的信息是否激活了SuperTab和jedi-vim?并完成了Ingo Karkat提出的建议.现在我想知道发生了什么问题以及如何解决.

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.

以下是输出:

: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

感觉不太好.这是我的.vimrc:

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>'

和我的〜/.vimrc.python

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

...这是"vim --version"的输出:

... 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 <[email protected]>
Compiled by <[email protected]>
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

推荐答案

我怀疑这行:au FileType python set omnifunc=pythoncomplete#Complete

只需将其从vimrc中删除.

just remove it from your vimrc.

如果这没有帮助,请发布:set omnifunc的输出.

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

我也建议删除绳索.我不知道它是否可以与Jedi配合使用,至少键映射是重叠的.

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

这篇关于Vim Supertab和jedi-vim的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 00:03