diff --git a/tips.md b/tips.md index cfa625c..9f076f4 100644 --- a/tips.md +++ b/tips.md @@ -25,23 +25,18 @@ Resort to this only if git cannot get updated certificates or if Github has TLS/ You can even go a step further and make `:PlugInstall` run on startup if there are any missing plugins. ```vim +" Put this code before Plug block (plug#begin ~ plug#end) + " Install vim-plug if not found if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim endif -call plug#begin() -if exists('g:loaded_plug') - " Uncommment the following line to install documentation - " Plug 'junegunn/vim-plug' - call plug#end() -endif - " Run PlugInstall if there are missing plugins -if exists('g:plugs') && len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC -endif +autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | source $MYVIMRC +\| endif ``` Note that this may increase the startup time of Vim.