为了测试,我尝试按照以下步骤安装本地插件:
克隆一些有用的插件到本地,比如vim-fugitive:
git clone https://github.com/tpope/vim-fugitive.git ~/devspace/vim-fugitive
Bundle '~/devspace/vim-fugitive.git
在.vimrc 文件中添加。vim +BundleInstall
在 shell 中执行。
除以下插件外,其他一切都已完成,日志为:
Bundle ~/devspace/vim-fugitive.git
$ git clone --recursive '~/devspace/vim-fugitive.git' '/home/USER/.vim/bundle/vim-fugitive'
> fatal: Could not switch to '~/devspace': No such file or directory^@
如果我理解不正确,请告诉我,谢谢。
- 更新 -
我只需将 .vimrc 更改为Bundle '/home/leiming/devspace/vim-fugitive'
,错误日志如下:
Bundle /home/leiming/devspace/vim-fugitive
$ git clone --recursive 'https://github.com/vim-scripts//home/leiming/devspace/vim-fugitive.git' '/home/leiming/.vim/bundle/home/leiming/devspace/vim-fugitive'
> Cloning into /home/leiming/.vim/bundle/home/leiming/devspace/vim-fugitive...^@error: The requested URL returned error: 403 while accessing https://github.com/vim-scripts//home/leiming/devspace/vim-fugitive.git/info/refs^@^@fatal: HTTP request failed^@
答案1
因为您克隆了~/devspace/vim-fugitive
但这不是存储库。因此请像这样更改:Bundle 'tpope/vim-fugitive'
如果您想在本地存储库上工作,请按照以下步骤操作:
" Git repos on your local machine (i.e. when working on your own plugin)
Bundle 'file:///Users/gmarik/path/to/plugin'
您可以在此处查看 vundle 配置:Github 上的 Vundle