Vundle基于Git架构,每一个插件都是一个项目的Repository,通过Vundle可以用简单的指令,一键安装/更新/删除所有插件。
1. 安装Git
运行cmd输入命令:git --version
如果可以看到版本信息说明配置成功。
前面我们讲述了Git安装,这里就不介绍了。安装好之后将Git的安装路径加入环境变量Path中,然后在cmd中输入git --version
查看是否安装成功。
2. 配置Curl脚本
在Git的路径下(C:\Program Files\Git\cmd)新建一个空文本文件(该脚本用于Vundle的远程链接),改名为curl.cmd,编辑内容为:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
@rem Do not use "echo off" to not affect any child calls. @setlocal @rem Get the abolute path to the parent directory, which is assumed to be the @rem Git installation root. @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\mingw64\bin;%PATH% @rem !!!!!!! For 64bit msysgit, replace 'mingw' above with 'mingw64' !!!!!!! @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% @curl.exe %* |
在cmd中用 curl --version
查看是否成功,成功显示版本信息
3. 安装Vundle
进入Vim的安装目录下,从github上Clone Vundle到该目录:
1 |
git clone https://github.com/VundleVim/Vundle.vim.git vimfiles/bundle/Vundle.vim |
4. 配置Vundle
按照Vundle官方给出的配置,所有通过Vundle安装的插件会被安装到Windows的用户目录下,这里做了修改,直接安装到Vim目录下方便管理。
1 2 |
set rtp+=~/.vim/bundle/Vundle.vim # 用户目录下 call vundle#begin() |
改为
1 2 |
set rtp+=$VIM/vimfiles/bundle/Vundle.vim/ call vundle#begin('$VIM/vimfiles/bundle/') |
完整配置如下(在这里我们添加一个配色方案solarized用于测试Vundle配置)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=$VIM/vimfiles/bundle/Vundle.vim/ call vundle#begin('$VIM/vimfiles/bundle/') " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' " plugin on GitHub repo Plugin 'altercation/vim-colors-solarized' " All of your Plugins must be added before the following line call vundle#end() " required filetype 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 |
命令模式下输入:VundleInstall
注意:安装gvim时一定要选full模式。
我的微信
扫一扫加我微信