Skip to content

Commit a6fa9c4

Browse files
committed
Add default packages
1 parent 31821be commit a6fa9c4

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

autoload/spacevim.vim

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ function! spacevim#bootstrap() abort
99
" Download the layers {{{
1010
if empty(glob(spacevim_layers_dir))
1111
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
1616
\])
1717
let waiting_for_layers = jobwait([install_layers])
1818
endif
@@ -40,14 +40,14 @@ function! spacevim#bootstrap() abort
4040
endif
4141
" }}}
4242

43-
" vim-plug automatic installation {{{
43+
" Setup and install vim-plug {{{
4444
if empty(glob(vim_plug))
4545
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'
5151
\])
5252
let waiting_for_plug = jobwait([install_plug])
5353
let install_plug_packages = jobstart(['nvim', '+PlugInstall', '+qall'])
@@ -56,7 +56,7 @@ function! spacevim#bootstrap() abort
5656
endif
5757
" }}}
5858

59-
" Plugin installation {{{
59+
" Install all plugins from enabled layers {{{
6060
call plug#begin(vim_plugged)
6161
Plug 'hecal3/vim-leader-guide'
6262
let g:spacevim_plugins = []
@@ -66,7 +66,7 @@ function! spacevim#bootstrap() abort
6666
endfor
6767

6868
for plugin in g:spacevim_plugins
69-
Plug plugin
69+
Plug plugin.name, plugin.config
7070
endfor
7171

7272
if exists('g:dotspacevim_additional_plugins')
@@ -80,8 +80,17 @@ function! spacevim#bootstrap() abort
8080
endfunction
8181

8282
" 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
8391

8492
function! spacevim#is_layer_enabled(name)
93+
" Check if a layer is enabled
8594
if !exists('g:spacevim_enabled_layers')
8695
return 1
8796
endif

vimrc.sample

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ if empty(glob(autoload_spacevim))
1616
\])
1717
let waiting_for_plug = jobwait([install_spacevim])
1818
endif
19-
2019
" }}}
2120

2221
" dotspacevim/init {{{
@@ -27,15 +26,19 @@ endif
2726
" IMPORTANT: For the moment, any changes in plugins or layers needs
2827
" a vim restart and :PlugInstall
2928
let g:dotspacevim_configuration_layers = [
30-
\ '+checkers/syntax-checking'
29+
\ '+nav/quit'
30+
\, '+nav/buffers'
31+
\, '+nav/windows'
32+
\, '+nav/text'
33+
\, '+nav/start-screen'
34+
\, '+checkers/syntax-checking'
3135
\]
3236

3337
let g:dotspacevim_additional_plugins = [
3438
\ 'flazz/vim-colorschemes'
3539
\]
3640

3741
" let g:dotspacevim_escape_key_sequence = 'fd'
38-
3942
" }}}
4043

4144
" dotspacevim/user-init {{{
@@ -52,7 +55,6 @@ endif
5255
if filereadable(config_dir . '/user-init.vim')
5356
execute 'source ' . config_dir . '/user-init.vim'
5457
endif
55-
5658
" }}}
5759

5860
call spacevim#bootstrap()
@@ -72,5 +74,4 @@ call spacevim#bootstrap()
7274
if filereadable(config_dir . '/user-init.vim')
7375
execute 'source ' . config_dir . '/user-config.vim'
7476
endif
75-
7677
" }}}

0 commit comments

Comments
 (0)