mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 22:20:06 +08:00
Add support for EVN SPACEVIMDIR
This commit is contained in:
parent
b79a736b3c
commit
0d92b51c68
@ -134,9 +134,10 @@ endfunction
|
||||
|
||||
|
||||
function! s:load_glob_conf() abort
|
||||
if filereadable(expand('~/.SpaceVim.d/init.toml'))
|
||||
let g:_spacevim_global_config_path = '~/.SpaceVim.d/init.toml'
|
||||
let local_conf = expand('~/.SpaceVim.d/init.toml')
|
||||
let global_dir = empty($SPACEVIMDIR) ? expand('~/.SpaceVim.d/') : $SPACEVIMDIR
|
||||
if filereadable(global_dir . 'init.toml')
|
||||
let g:_spacevim_global_config_path = global_dir . 'init.toml'
|
||||
let local_conf = global_dir . 'init.toml'
|
||||
let local_conf_cache = expand('~/.cache/SpaceVim/conf/init.json')
|
||||
if getftime(local_conf) < getftime(local_conf_cache)
|
||||
let conf = s:JSON.json_decode(join(readfile(local_conf_cache, ''), ''))
|
||||
@ -146,12 +147,11 @@ function! s:load_glob_conf() abort
|
||||
call writefile([s:JSON.json_encode(conf)], local_conf_cache)
|
||||
call SpaceVim#custom#apply(conf)
|
||||
endif
|
||||
elseif filereadable(expand('~/.SpaceVim.d/init.vim'))
|
||||
let g:_spacevim_global_config_path = '~/.SpaceVim.d/init.vim'
|
||||
let custom_glob_conf = expand('~/.SpaceVim.d/init.vim')
|
||||
if isdirectory(expand('~/.SpaceVim.d/'))
|
||||
set runtimepath^=~/.SpaceVim.d
|
||||
endif
|
||||
exe 'set runtimepath^=' . global_dir
|
||||
elseif filereadable(global_dir . 'init.vim')
|
||||
let g:_spacevim_global_config_path = global_dir . 'init.vim'
|
||||
let custom_glob_conf = global_dir . 'init.vim'
|
||||
exe 'set runtimepath^=' . global_dir
|
||||
exe 'source ' . custom_glob_conf
|
||||
else
|
||||
if has('timers')
|
||||
|
Loading…
Reference in New Issue
Block a user