我正在尝试设置我的 vim,以便我可以以 root 用户身份使用我的设置,而不会弄乱 root 的 .vim 和 .vimrc。
当从我自己的用户调用时,我的 vim 设置工作得很好。但是,当从 root 用户调用时,我得到:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()
我已经在我的 .vimrc 中设置了运行时路径,并使用调试运行提供以下信息:
chdir(/home/pricery)
fchdir() to previous dir
sourcing "/home/pricery/.vimrc"
Searching for "autoload/pathogen.vim" in "/home/pricery/.vim,/usr/share/vim/vim74"
Searching for "/home/pricery/.vim/autoload/pathogen.vim"
chdir(/home/pricery/.vim/autoload)
fchdir() to previous dir
line 5: sourcing "/home/pricery/.vim/autoload/pathogen.vim"
finished sourcing /home/pricery/.vim/autoload/pathogen.vim
continuing in /home/pricery/.vimrc
Searching for "autoload/pathogen.vim" in "/home/pricery/.vim,/usr/share/vim/vim74"
Searching for "/home/pricery/.vim/autoload/pathogen.vim"
chdir(/home/pricery/.vim/autoload)
fchdir() to previous dir
line 5: sourcing "/home/pricery/.vim/autoload/pathogen.vim"
finished sourcing /home/pricery/.vim/autoload/pathogen.vim
continuing in /home/pricery/.vimrc
Error detected while processing /home/pricery/.vimrc:
line 5:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()
finished sourcing /home/pricery/.vimrc
Searching for "plugin/**/*.vim" in "/home/pricery/.vim,/usr/share/vim/vim74"
Searching for "/home/pricery/.vim/plugin/**/*.vim"
Searching for "/usr/share/vim/vim74/plugin/**/*.vim"
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
...
据我所知,它找到了我的 .vim 文件夹并很好地加载了 pathology.vim,但是仍然会抛出不知道 pathology#infect 函数的错误,因此不会加载我的其余插件。
有人知道我缺少什么吗?