【发布时间】:2012-10-26 03:53:16
【问题描述】:
这应该是一个非常简单的问题。我有一个简单的.vimrc 文件。总共15行:
filetype off
set nocompatible
call pathogen#infect()
syntax on
filetype plugin indent on
set hlsearch
set colorcolumn=79
set number
set list
set expandtab
set tabstop=4
set softtabstop=4
colorscheme vividchalk
但是,当我尝试启动 vim 时,我收到以下错误消息:
Error detected while processing /Users/Jon/.vimrc:
line 3:
E117: Unknown function: pathogen#infect
line 15:
E185: Cannot find color scheme 'vividchalk'
我在解决这个问题上工作了很长时间,包括看这里:Vim: Pathogen not loading 和这里:Pathogen does not load plugins 和这里:https://github.com/tpope/vim-pathogen/issues/50
我将所有与 vim 相关的文件存储在 ~/.dotfiles/vim/ 目录中,并在我的主目录中符号链接了 .vimrc 和 .gvimrc 和 .vim/。我尝试加载三个插件:command-t、commentary 和 fugitive。这些插件都是 git 子模块。目录结构如下:
.dotfiles/
├──vim/
├── autoload/
│ └── pathogen.vim
├── bundle/
│ ├── command-t/
│ ├── commentary/
│ └── fugitive/
├── colors/
│ ├── distinguished.vim
│ └── vividchalk.vim
├── ftdetect/
│ ├── markdown.vim
│ └── vim.vim
├── gvimrc
├── snippets/
│ └── markdown.snippets
├── syntax/
│ ├── markdown.vim
│ └── python.vim
├── test.txt
└── vimrc
【问题讨论】:
-
为什么是
~/.dotfiles/目录?这可能是把事情搞砸了。