autocmd VimEnter * PlugInstall --sync | source ~/.vim/init.vim
endif
+
call plug#begin('~/.vim/plugged')
+
source ~/.vim/plugins.vim
+
+" Load various conditinoal plugin sets
+if filereadable($HOME . '/.vim/plugins-local.vim')
+ source ~/.vim/plugins-local.vim
+endif
+
+if $USER != "root"
+ source ~/.vim/plugins-noroot.vim
+
+ if g:lowendbox == 0
+ source ~/.vim/plugins-noroot-nolowendbox.vim
+ endif
+endif
+
call plug#end()
-"Automatically install missing plugins
-"https://github.com/junegunn/vim-plug/wiki/extra
-autocmd VimEnter *
- \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
- \| PlugInstall --sync | q
- \| endif
+
+" Call the config functions of the plugins
+call PluginsConfig()
+if filereadable($HOME . '/.vim/plugins-local.vim')
+ call PluginsLocalConfig()
+endif
+if $USER != "root"
+ call PluginsNorootConfig()
+ if g:lowendbox == 0
+ call PluginsNorootNolowendboxConfig()
+ endif
+endif
+
+
+function s:PostConfig()
+ "Automatically install missing plugins
+ "https://github.com/junegunn/vim-plug/wiki/extra
+ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
+ PlugInstall --sync | q
+ endif
+endfunction
+
+autocmd VimEnter * call s:PostConfig()