diff options
author | adam <56338480+adastx@users.noreply.github.com> | 2022-08-13 09:53:51 +0200 |
---|---|---|
committer | adam <56338480+adastx@users.noreply.github.com> | 2022-08-13 10:01:23 +0200 |
commit | f8601c1a6978e926cedd5ef6843f98a6845b21f5 (patch) | |
tree | 68764208dda996bf6c94b5036e056727bca1ea8b | |
parent | 3dfaec55ef98cc1a5cfa1430c99ff79a4d611053 (diff) |
vim: bootstrap vim-plug
-rw-r--r-- | .config/vim/vimrc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 0984fc1..8dc7f1e 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -15,7 +15,16 @@ set directory=$XDG_CACHE_HOME/vim/swap | call mkdir(&directory, 'p') set undodir=$XDG_CACHE_HOME/vim/undo | call mkdir(&undodir, 'p') set undofile -call plug#begin('~/.config/vim/plugged') +let data_dir = '$XDG_DATA_HOME/vim' +if empty(glob(data_dir . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +endif + +autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | source $MYVIMRC +\| endif + +call plug#begin(data_dir . '/plugged') Plug 'romgrk/doom-one.vim' Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' |