Install Plug and extensions on first run

2 Points

Chris Sexton Chris Sexton

10 years ago

A preamble that installs Plug and desired extensions (vundle compatible) on initial load. No dependencies required in your .vim directory!

set nocompatible

let iCanHazPlugged=1
let vim_plug_file=expand("~/.vim/autoload/plug.vim")
if !filereadable(vim_plug_file)
	echo "Installing vim-plug"
	echo ""
	silent !mkdir -p ~/.vim/autoload
	silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
	let iCanHazPlugged=0
endif

call plug#begin()

" My Plugs here:
Plug 'ctrlp.vim'
Plug 'ervandew/supertab'
Plug 'syntastic'
" ...

call plug#end()

if iCanHazPlugged == 0
	echo "Installing plugs"
	echo ""
	:PlugUpdate
endif

yang-ling

yang-ling 10 years ago

You should try NeoBundle: https://github.com/Shougo/neobundle.vim

Martínez Ortiz Saúl Axel

Martínez Ortiz Saúl Axel 6 years ago

What can NeoBundle do better or easier?