diff --git a/vim/.vimrc b/vim/.vimrc index 8c8c337..48c75f8 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -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 diff --git a/vim/README.md b/vim/README.md index 2b296f4..b22045e 100644 --- a/vim/README.md +++ b/vim/README.md @@ -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