mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:00:04 +08:00
Improve toml support
This commit is contained in:
parent
eac74ec4a0
commit
95f27aaf20
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user