1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 02:20:03 +08:00

Add support for EVN SPACEVIMDIR

This commit is contained in:
wsdjeg 2018-04-29 13:48:12 +08:00
parent b79a736b3c
commit 0d92b51c68

View File

@ -134,9 +134,10 @@ endfunction
function! s:load_glob_conf() abort function! s:load_glob_conf() abort
if filereadable(expand('~/.SpaceVim.d/init.toml')) let global_dir = empty($SPACEVIMDIR) ? expand('~/.SpaceVim.d/') : $SPACEVIMDIR
let g:_spacevim_global_config_path = '~/.SpaceVim.d/init.toml' if filereadable(global_dir . 'init.toml')
let local_conf = expand('~/.SpaceVim.d/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') let local_conf_cache = expand('~/.cache/SpaceVim/conf/init.json')
if getftime(local_conf) < getftime(local_conf_cache) if getftime(local_conf) < getftime(local_conf_cache)
let conf = s:JSON.json_decode(join(readfile(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 writefile([s:JSON.json_encode(conf)], local_conf_cache)
call SpaceVim#custom#apply(conf) call SpaceVim#custom#apply(conf)
endif endif
elseif filereadable(expand('~/.SpaceVim.d/init.vim')) exe 'set runtimepath^=' . global_dir
let g:_spacevim_global_config_path = '~/.SpaceVim.d/init.vim' elseif filereadable(global_dir . 'init.vim')
let custom_glob_conf = expand('~/.SpaceVim.d/init.vim') let g:_spacevim_global_config_path = global_dir . 'init.vim'
if isdirectory(expand('~/.SpaceVim.d/')) let custom_glob_conf = global_dir . 'init.vim'
set runtimepath^=~/.SpaceVim.d exe 'set runtimepath^=' . global_dir
endif
exe 'source ' . custom_glob_conf exe 'source ' . custom_glob_conf
else else
if has('timers') if has('timers')