Auto Installing Vundle From Your Vimrc

Vundle allows you to specify in your vimrc what vim plugins you wish to load, and it’ll automatically download (git clone if possible) and enable vim plugins.

Vundle can get a name of a plugin as it appears in the vim plugin directory, a github “:user/:repo” style string, and even a full git url.

vimrc

1
2
3
Bundle 'Syntastic' "uber awesome syntax and errors highlighter
Bundle 'altercation/vim-colors-solarized' "T-H-E colorscheme
Bundle 'https://github.com/tpope/vim-fugitive' "So awesome, it should be illegal 

Vundle also updates your vim plugins with a simple command :

Update all your bundles

1
:BundleInstall!

Vundle is awesome, it saves a lot of the manual work needed in pathogen.

Even more if your installing your vim plugins manually, oy vei.

However, there’s always the fuss of getting it installed on a fresh machine. Adding these lines to your .vimrc, fixes that :

vimrc with vundle-o-maticEntire .vimrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
" Setting up Vundle - the vim plugin bundler
    let iCanHazVundle=1
    let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
    if !filereadable(vundle_readme)
        echo "Installing Vundle.."
        echo ""
        silent !mkdir -p ~/.vim/bundle
        silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
        let iCanHazVundle=0
    endif
    set rtp+=~/.vim/bundle/vundle/
    call vundle#rc()
    Bundle 'gmarik/vundle'
    "Add your bundles here
    Bundle 'Syntastic' "uber awesome syntax and errors highlighter
    Bundle 'altercation/vim-colors-solarized' "T-H-E colorscheme
    Bundle 'https://github.com/tpope/vim-fugitive' "So awesome, it should be illegal 
    "...All your other bundles...
    if iCanHazVundle == 0
        echo "Installing Bundles, please ignore key map error messages"
        echo ""
        :BundleInstall
    endif
" Setting up Vundle - the vim plugin bundler end

This will clone vundle and activate it, and install all your bundles (if vundle is not installed).

Disclaimer : Works on my machine ;)

This should work on any *nix machine, although windows 7 should cope with it too (not tested lately)

Enjoy!

 

转自:http://erikzaadi.com/2012/03/19/auto-installing-vundle-from-your-vimrc/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值