aboutsummaryrefslogtreecommitdiff
path: root/.vim/plugin/init.vim
diff options
context:
space:
mode:
Diffstat (limited to '.vim/plugin/init.vim')
-rw-r--r--.vim/plugin/init.vim28
1 files changed, 28 insertions, 0 deletions
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()