diff --git a/autoload/SpaceVim/custom.vim b/autoload/SpaceVim/custom.vim index 14fb15df7..f441eb145 100644 --- a/autoload/SpaceVim/custom.vim +++ b/autoload/SpaceVim/custom.vim @@ -76,12 +76,18 @@ endfunction function! SpaceVim#custom#apply(config) abort - let config = json_decode(a:config) - for key in keys(config) - if exists('g:spacevim_' . key) - exe 'let g:spacevim_' . key . ' = "' . config[key] . '"' - endif - endfor + if type(a:config) != type({}) + call SpaceVim#logger#info('config type is wrong!') + else + let options = get(a:config, 'options', {}) + for [name, value] in items(options) + exe 'let g:spacevim_' . name . ' = value' + endfor + let layers = get(a:config, 'layers', {}) + for layer in layers + call SpaceVim#layers#load(layer.name, layer) + endfor + endif endfunction function! SpaceVim#custom#write(force) abort diff --git a/mode/basic.toml b/mode/basic.toml index 9987262a0..3eecc2222 100644 --- a/mode/basic.toml +++ b/mode/basic.toml @@ -1,7 +1,7 @@ # This is basic configuration example for SpaceVim # All SpaceVim option below [option] section -[option] +[options] # set spacevim theme. by default colorscheme layer is not loaded, # if you want to use more colorscheme, please load the colorscheme # layer