@@ -9,10 +9,10 @@ function! spacevim#bootstrap() abort
9
9
" Download the layers {{{
10
10
if empty (glob (spacevim_layers_dir))
11
11
let install_layers = jobstart ([
12
- \ ' git' ,
13
- \ ' clone' ,
14
- \ ' [email protected] :Tehnix/spaceneovim-layers.git' ,
15
- \ spacevim_layers_dir
12
+ \ ' git'
13
+ \, ' clone'
14
+ \, ' [email protected] :Tehnix/spaceneovim-layers.git'
15
+ \, spacevim_layers_dir
16
16
\] )
17
17
let waiting_for_layers = jobwait ([install_layers])
18
18
endif
@@ -40,14 +40,14 @@ function! spacevim#bootstrap() abort
40
40
endif
41
41
" }}}
42
42
43
- " vim-plug automatic installation {{{
43
+ " Setup and install vim-plug {{{
44
44
if empty (glob (vim_plug))
45
45
let install_plug = jobstart ([
46
- \ ' curl' ,
47
- \ ' -fLo' ,
48
- \ vim_plug,
49
- \ ' --create-dirs' ,
50
- \ ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
46
+ \ ' curl'
47
+ \, ' -fLo'
48
+ \, vim_plug
49
+ \, ' --create-dirs'
50
+ \, ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
51
51
\] )
52
52
let waiting_for_plug = jobwait ([install_plug])
53
53
let install_plug_packages = jobstart ([' nvim' , ' +PlugInstall' , ' +qall' ])
@@ -56,7 +56,7 @@ function! spacevim#bootstrap() abort
56
56
endif
57
57
" }}}
58
58
59
- " Plugin installation {{{
59
+ " Install all plugins from enabled layers {{{
60
60
call plug#begin (vim_plugged)
61
61
Plug ' hecal3/vim-leader-guide'
62
62
let g: spacevim_plugins = []
@@ -66,7 +66,7 @@ function! spacevim#bootstrap() abort
66
66
endfor
67
67
68
68
for plugin in g: spacevim_plugins
69
- Plug plugin
69
+ Plug plugin .name, plugin .config
70
70
endfor
71
71
72
72
if exists (' g:dotspacevim_additional_plugins' )
@@ -80,8 +80,17 @@ function! spacevim#bootstrap() abort
80
80
endfunction
81
81
82
82
" Helper functions {{{
83
+ function ! spacevim#add_plugin (name, config)
84
+ " Add a plugin to the list of plugins
85
+ if exists (' g:spacevim_plugins' )
86
+ call add (g: spacevim_plugins , {' name' : a: name , ' config' : a: config })
87
+ return 1
88
+ endif
89
+ return 0
90
+ endfunction
83
91
84
92
function ! spacevim#is_layer_enabled (name)
93
+ " Check if a layer is enabled
85
94
if ! exists (' g:spacevim_enabled_layers' )
86
95
return 1
87
96
endif
0 commit comments