diff options
| author | jdhao <jdhao@hotmail.com> | 2020-10-31 00:34:15 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2020-10-31 00:34:15 +0800 |
| commit | dbe24697f35e2d56b1e69b9ab0790fb238ac35e9 (patch) | |
| tree | 81b22614e10fd9fec155ebef93780f01b533f379 /plugins.vim | |
| parent | b1f07af6fe4d86d5ccb166a81ec7a4261404ae13 (diff) | |
Move vim-plug installation outside of config.
It is a one-time thing. Do not waste precious time checking it every
time we start Nvim.
Diffstat (limited to 'plugins.vim')
| -rw-r--r-- | plugins.vim | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/plugins.vim b/plugins.vim index 6e1d0ba..67afc99 100644 --- a/plugins.vim +++ b/plugins.vim @@ -1,30 +1,15 @@ scriptencoding utf-8 "{ Plugin installation -"{{ Vim-plug Install and related settings - -" Auto-install vim-plug on different systems if it does not exist. For -" Windows, only Windows 10 with curl installed are supported (after Windows 10 -" build 17063, source: -" https://devblogs.microsoft.com/commandline/tar-and-curl-come-to-windows/). -" The following script to install vim-plug is adapted from vim-plug -" wiki: https://github.com/junegunn/vim-plug/wiki/tips#tips -let g:vim_plug_fpath = expand(stdpath('data') . '/site/autoload/plug.vim') -if (g:is_win || g:is_mac) && !filereadable(g:vim_plug_fpath) - if !executable('curl') - echoerr 'Curl not available on your system, you may install vim-plug by yourself.' - finish - endif - echomsg 'Installing Vim-plug on your system' - let g:vim_plug_furl = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - silent execute printf('!curl -fLo %s --create-dirs %s', g:vim_plug_fpath, g:vim_plug_furl) - augroup plug_init - autocmd! - autocmd VimEnter * PlugInstall --sync | quit |source $MYVIMRC +"{{ Vim-plug related settings. +" The root directory to install all plugins. +let g:PLUGIN_HOME=expand(stdpath('data') . '/plugged') + +if empty(readdir(g:PLUGIN_HOME)) + augroup plug_init + autocmd! + autocmd VimEnter * PlugInstall --sync | quit |source $MYVIMRC augroup END endif - -" The directory to install plugins. -let g:PLUGIN_HOME=expand(stdpath('data') . '/plugged') "}} "{{ Autocompletion related plugins |
