mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:10:06 +08:00
Add json example (#1625)
* Add json example * Add json func * Add json support
This commit is contained in:
parent
9a4b0281fe
commit
b362f23bec
@ -595,6 +595,13 @@ function! SpaceVim#loadCustomConfig() abort
|
||||
exe 'source ' . custom_glob_conf
|
||||
endif
|
||||
|
||||
" json config
|
||||
let json_global = expand('~/.SpaceVim.d/init.json')
|
||||
if filereadable(json_global)
|
||||
let config = join(readfile(json_global), '')
|
||||
call SpaceVim#custom#apply(config)
|
||||
endif
|
||||
|
||||
if g:spacevim_enable_ycm && g:spacevim_snippet_engine !=# 'ultisnips'
|
||||
call SpaceVim#logger#info('YCM only support ultisnips, change g:spacevim_snippet_engine to ultisnips')
|
||||
let g:spacevim_snippet_engine = 'ultisnips'
|
||||
|
@ -70,3 +70,17 @@ endfunction
|
||||
function! SpaceVim#custom#SPCGroupName(keys, name) abort
|
||||
call add(g:_spacevim_mappings_space_custom_group_name, [a:keys, a:name])
|
||||
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
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#custom#write(force) abort
|
||||
|
||||
endfunction
|
||||
|
10
mode/basic.json
Normal file
10
mode/basic.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"colorscheme": "grubox",
|
||||
"background": "dark",
|
||||
"guicolors": true,
|
||||
"statusline_separator": "nil",
|
||||
"statusline_inactive_separator": "bar",
|
||||
"buffer_index_type": 4,
|
||||
"filetype_icon": false,
|
||||
"statusline_display_mode": false
|
||||
}
|
Loading…
Reference in New Issue
Block a user