mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +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
|
function! SpaceVim#custom#apply(config) abort
|
||||||
let config = json_decode(a:config)
|
if type(a:config) != type({})
|
||||||
for key in keys(config)
|
call SpaceVim#logger#info('config type is wrong!')
|
||||||
if exists('g:spacevim_' . key)
|
else
|
||||||
exe 'let g:spacevim_' . key . ' = "' . config[key] . '"'
|
let options = get(a:config, 'options', {})
|
||||||
endif
|
for [name, value] in items(options)
|
||||||
endfor
|
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
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#custom#write(force) abort
|
function! SpaceVim#custom#write(force) abort
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# This is basic configuration example for SpaceVim
|
# This is basic configuration example for SpaceVim
|
||||||
|
|
||||||
# All SpaceVim option below [option] section
|
# All SpaceVim option below [option] section
|
||||||
[option]
|
[options]
|
||||||
# set spacevim theme. by default colorscheme layer is not loaded,
|
# set spacevim theme. by default colorscheme layer is not loaded,
|
||||||
# if you want to use more colorscheme, please load the colorscheme
|
# if you want to use more colorscheme, please load the colorscheme
|
||||||
# layer
|
# layer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user