我讀到omnicompletion應該可以「開箱即用」,但它沒有,我不知道我做錯了什麼。Vim Omnicomplete模式未找到(Python)
我整理了最新版本的VIM,使其顯示 「+蟒蛇」:
user$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 16 2013 11:22:56)
MacOS X (unix) version
Compiled by [email protected]
Normal 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
-conceal +cryptv -cscope +cursorbind +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 -lua +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 +persistent_undo +postscript +printer -profile +python
-python3 +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: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/Users/user/Software/vim/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -no-cpp-precomp -g -O2 -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -framework Cocoa -framework Python
我清空了我的.vimrc見好就收:
" Automatic reloading of .vimrc
autocmd! bufwritepost .vimrc source %
filetype plugin on
和我的〜/ vim的/目錄只是
autoload/pythoncomplete.vim
這是我從http://www.vim.org/scripts/script.php?script_id=1542
下載和下面的命令返回:
:echo &omnifunc
pythoncomplete#Complete
這似乎是罰款。但每次我做了以下test.py文件控制XO:
#! /usr/bin/env python
import numpy
numpy.r
無論是打字後「編號」或「numpy.r」我得到
Omni completion (^O^N^P) Pattern not found
是否有一個問題我安裝?任何想法都不勝感激。謝謝。
編輯:根據TankorSmash關於安裝python-mode的建議,我可以通過「num」完成「numpy」而不是「numpy.r」來完成任何事情。
這是我的新.vimrc文件:
" Automatic reloading of .vimrc
autocmd! bufwritepost .vimrc source %
" Pathogen load
filetype off
call pathogen#infect()
call pathogen#helptags()
filetype plugin indent on
syntax on
和我的vim的目錄樹:
.vim
autoload
pathogen.vim
pythoncomplete.vim
bundle
python-mode
任何想法?
我會建議使用jedi-vim代替pythoncomplete:https://github.com/davidhalter/jedi。 – 2013-02-20 19:24:33