首页 > 代码库 > 安装 Vbundle 的笔记

安装 Vbundle 的笔记

Vbundle 挺好用的,能够很方便管理Vim的一些插件。虽然Vbundle的安装方法看的很简单,但是它的配置却让我弄了很久,现在记录如下,方便后面安装时再出现相同的问题:

我按照这里的官方提示的安装方法:https://github.com/VundleVim/Vundle.vim 来安装的

(注意:Vbundle之前有一个比较老的版本,现在的这个是新版本,所以安装和配置都按照最新的版本来)

官方的安装方法如下(再Linux下忽略 1. ,直接从 2.  开始)

  1. Introduction:

    Installation requires Git and triggers git clone for each configured repository to ~/.vim/bundle/ by default. Curl is required for search.

    If you are using Windows, go directly to Windows setup. If you run into any issues, please consult the FAQ. See Tips for some advanced configurations.

    Using non-POSIX shells, such as the popular Fish shell, requires additional setup. Please check the FAQ.

  2. Set up Vundle:

    $ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

  3. Configure Plugins:

    Put this at the top of your .vimrc to use Vundle. Remove plugins you don‘t need, they are for illustration purposes.

    set nocompatible              " be iMproved, requiredfiletype off                  " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin(‘~/some/path/here‘)" let Vundle manage Vundle, requiredPlugin ‘VundleVim/Vundle.vim" The following are examples of different formats supported." Keep Plugin commands between vundle#begin/end." plugin on GitHub repoPlugin ‘tpope/vim-fugitive" plugin from http://vim-scripts.org/vim/scripts.htmlPlugin ‘L9" Git plugin not hosted on GitHubPlugin ‘git://git.wincent.com/command-t.git" git repos on your local machine (i.e. when working on your own plugin)Plugin ‘file:///home/gmarik/path/to/plugin" The sparkup vim script is in a subdirectory of this repo called vim." Pass the path to set the runtimepath properly.Plugin ‘rstacruz/sparkup‘, {‘rtp‘: ‘vim/‘}" Install L9 and avoid a Naming conflict if you‘ve already installed a" different version somewhere else.Plugin ‘ascenator/L9‘, {‘name‘: ‘newL9‘}" All of your Plugins must be added before the following linecall vundle#end()            " requiredfiletype plugin indent on    " required" To ignore plugin indent changes, instead use:"filetype plugin on"" Brief help" :PluginList       - lists configured plugins" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate" :PluginSearch foo - searches for foo; append `!` to refresh local cache" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal"" see :h vundle for more details or wiki for FAQ" Put your non-Plugin stuff after this line
  4. Install Plugins:

    Launch vim and run :PluginInstall

    To install from command line: vim +PluginInstall +qall

 

我的问题就出现在了配置这块,按照他的方法,我将配置文件放到了我的 .vimrc 的最顶部,然后再运行 :PluginInstall的时候会提示:

unknown function vundle#installer#new  的错误

然后就去找方法:

稍微相关的有:

https://alankydd.wordpress.com/2012/09/09/unknown-function-vundleinstallernew/

不够最后我按照上面的方法一开始也没有成功,直到我:

把 vundle 相关的配置信息放到了我的 .vimrc  的最底部, 这最终才成功了;

 

安装 Vbundle 的笔记