chore(nvim): add plugin section with auto-install of vim-plug

This commit is contained in:
Stefan Imhoff
2021-12-02 19:21:09 +01:00
parent e9d52cf1f3
commit 59f3e252dd

View File

@@ -183,3 +183,19 @@ function! ToggleWrap()
setlocal display+=lastline setlocal display+=lastline
endif endif
endfunction endfunction
" *** *** *** Plugins *** *** ***
" *******************************
" Automatically install vim-plug
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.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'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin(data_dir . '/plugins')
call plug#end()
doautocmd User PlugLoaded