From 06929ba11c0ef83da2462f60ee8c6dc07a2aa9a4 Mon Sep 17 00:00:00 2001 From: gxlin Date: Tue, 16 Mar 2021 10:42:48 +0800 Subject: Split .vimrc to multiple vimscript files --- .vim/plugins/init.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .vim/plugins/init.vim (limited to '.vim/plugins/init.vim') diff --git a/.vim/plugins/init.vim b/.vim/plugins/init.vim new file mode 100644 index 0000000..590f18c --- /dev/null +++ b/.vim/plugins/init.vim @@ -0,0 +1,19 @@ +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('~/.dotfiles/.vim/plugins/*.vim')) + +function! s:load_plugins() + for plugin in s:plugins + if plugin !~ 'init.vim' + exec "source " . plugin + endif + endfor +endfunction + +call plug#begin('~/.vim/plugged') +call s:load_plugins() +call plug#end() -- cgit v1.2.3