我最近从 Ubuntu 搬到了 Mac osx。我的第一件事就是带上我的 vim。
我从 vim.org 下载源代码并用 gcc 编译。(我会将版本输出放在帖子底部)
我将pathogen.vim 添加到 ~/.vim/autoload 目录。但是当我在 ~/.vim/vimrc 中添加代码时:
execute pathogen#infect()
尝试启动 vim 时出现错误,这是错误输出:
Error detected while processing /Users/jack/.vim/vimrc:
line 3:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()
Press ENTER or type command to continue
首先,我虽然可能 vim 没有加载 Pathogen.vim,但是 :scriptnames 显示它确实加载了!
1: ~/.vim/vimrc
2: ~/.vim/bundle/vim-pathogen/autoload/pathogen.vim
在我运行 :function 之后,有些东西引起了我的注意,在感染函数之后有一个“中止”,我搜索了一下,发现它也没有解决我的问题:
function pathogen#legacyjoin(...) abort
function pathogen#runtime_append_all_bundles(...) abort
function pathogen#surround(path) abort
function <SNR>2_Findcomplete(A, L, P)
function pathogen#uniq(list) abort
function pathogen#incubate(...) abort
function pathogen#glob(pattern) abort
function <SNR>2_warn(msg)
function pathogen#runtime_findfile(file, count) abort
function pathogen#separator() abort
function pathogen#runtime_prepend_subdirectories(path)
function pathogen#glob_directories(pattern) abort
function pathogen#infect(...) abort
function pathogen#is_disabled(path)
function pathogen#join(...) abort
function pathogen#cycle_filetype()
function pathogen#split(path) abort
function <SNR>2_find(count, cmd, file, lcd)
function pathogen#fnameescape(string) abort
function pathogen#execute(...) abort
function pathogen#helptags() abort
谁能帮忙指出我应该怎么做才能解决这个问题?
这是使用命令“vim --version”的版本输出:
JacktekiMac-Pro:.vim$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 6 2013 17:01:30)
MacOS X (unix) version
Huge version without GUI. Features included (+) or not (-):
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent -gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
+clipboard +iconv +path_extra -toolbar
+cmdline_compl +insert_expand -perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python/dyn +viminfo
-cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu -ruby +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra -mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop
+farsi +mouse_netterm +syntax
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -no-cpp-precomp -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -o vim -lm -lncurses -liconv -framework Cocoa