From d4e1469e4b0c5aaf5c23be555e8b224f9254d781 Mon Sep 17 00:00:00 2001 From: gxlin Date: Thu, 15 Jul 2021 21:28:06 +0800 Subject: A usable boostrap config --- .vim/plugin/init.vim | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .vim/plugin/init.vim (limited to '.vim/plugin/init.vim') diff --git a/.vim/plugin/init.vim b/.vim/plugin/init.vim new file mode 100644 index 0000000..7f71d9c --- /dev/null +++ b/.vim/plugin/init.vim @@ -0,0 +1,28 @@ +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 + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + +let s:plugins = split(expand('~/.vim/plugin/*.plug')) +let s:settings = split(expand('~/.vim/plugin/*.vim')) + +function! s:load_plugins() + for plugin in s:plugins + exec "source " . plugin + endfor +endfunction + +function! s:load_settings() + for setting in s:settings + if setting !~ 'init.vim' + exec "source " . setting + endif + endfor +endfunction + +call plug#begin('~/.vim/plugged') +call s:load_plugins() +call plug#end() + +call s:load_settings() -- cgit v1.2.3