vim: Install vim-plug if it is not present

This commit means that manually copy/pasting the curl command on new
machines is no longer necessary.
This commit is contained in:
Donovan Glover 2018-10-31 12:28:54 -04:00
parent 8056132e7b
commit 2fa91642d3
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 10 additions and 7 deletions

View File

@ -5,6 +5,15 @@ if &shell =~# 'fish$'
set shell=sh
endif
let plugsys = glob('/usr/share/vim/vimfiles/autoload/plug.vim')
let plugusr = glob('~/.vim/autoload/plug.vim')
if empty(plugsys) && empty(plugusr)
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/0.10.0/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'dylanaraps/wal.vim' " Color scheme
Plug 'airblade/vim-gitgutter' " Git diff

View File

@ -20,12 +20,6 @@ make package=vim
## Usage
I use [vim-plug][vim-plug] as my plugin manager of choice. Install it, then run:
```
vim +PlugInstall +qall
```
Now you can use my vim config with all the plugins installed!
I use [vim-plug][vim-plug] as my plugin manager of choice. If it isn't installed already, my `.vimrc` will install it for you. If you already have vim-plug installed, run `:PlugInstall`. Now you can use my vim config with all the plugins enabled!
[vim-plug]: https://github.com/junegunn/vim-plug