mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 20:20:05 +08:00
Add .SpaceVim.d/after to the end of rtp (#4136)
This commit is contained in:
parent
50c7c3bebc
commit
ad913f2db4
@ -62,7 +62,7 @@ endfunction
|
||||
|
||||
function! s:global_dir() abort
|
||||
if empty($SPACEVIMDIR)
|
||||
return s:FILE.unify_path('~/.SpaceVim.d/')
|
||||
return s:FILE.unify_path('~/.SpaceVim.d/')
|
||||
else
|
||||
return s:FILE.unify_path($SPACEVIMDIR)
|
||||
endif
|
||||
@ -183,8 +183,9 @@ endfunction
|
||||
function! SpaceVim#custom#load() abort
|
||||
" if file .SpaceVim.d/init.toml exist
|
||||
if filereadable('.SpaceVim.d/init.toml')
|
||||
let g:_spacevim_config_path = s:CMP.resolve(fnamemodify('.SpaceVim.d/init.toml', ':p'))
|
||||
let &rtp = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d', ':p:h'))) . ',' . &rtp
|
||||
let local_dir = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d/', ':p:h')))
|
||||
let g:_spacevim_config_path = local_dir . 'init.toml'
|
||||
let &rtp = local_dir . ',' . &rtp . ',' . local_dir . 'after'
|
||||
let local_conf = g:_spacevim_config_path
|
||||
call SpaceVim#logger#info('find local conf: ' . local_conf)
|
||||
let local_conf_cache = s:path_to_fname(local_conf)
|
||||
@ -203,8 +204,9 @@ function! SpaceVim#custom#load() abort
|
||||
call s:load_glob_conf()
|
||||
endif
|
||||
elseif filereadable('.SpaceVim.d/init.vim')
|
||||
let g:_spacevim_config_path = fnamemodify('.SpaceVim.d/init.vim', ':p')
|
||||
let &rtp = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d', ':p:h'))) . ',' . &rtp
|
||||
let local_dir = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d/', ':p:h')))
|
||||
let g:_spacevim_config_path = local_dir . 'init.vim'
|
||||
let &rtp = local_dir . ',' . &rtp . ',' . local_dir . 'after'
|
||||
let local_conf = g:_spacevim_config_path
|
||||
call SpaceVim#logger#info('find local conf: ' . local_conf)
|
||||
exe 'source .SpaceVim.d/init.vim'
|
||||
@ -232,7 +234,7 @@ function! s:load_glob_conf() abort
|
||||
let g:_spacevim_global_config_path = global_dir . 'init.toml'
|
||||
let local_conf = global_dir . 'init.toml'
|
||||
let local_conf_cache = s:FILE.unify_path(expand(g:spacevim_data_dir.'/SpaceVim/conf/' . fnamemodify(resolve(local_conf), ':t:r') . '.json'))
|
||||
let &rtp = global_dir . ',' . &rtp
|
||||
let &rtp = global_dir . ',' . &rtp . ',' . global_dir . 'after'
|
||||
if getftime(resolve(local_conf)) < getftime(resolve(local_conf_cache))
|
||||
let conf = s:JSON.json_decode(join(readfile(local_conf_cache, ''), ''))
|
||||
call SpaceVim#custom#apply(conf, 'glob')
|
||||
@ -244,7 +246,7 @@ function! s:load_glob_conf() abort
|
||||
elseif filereadable(global_dir . 'init.vim')
|
||||
let g:_spacevim_global_config_path = global_dir . 'init.vim'
|
||||
let custom_glob_conf = global_dir . 'init.vim'
|
||||
let &rtp = global_dir . ',' . &rtp
|
||||
let &rtp = global_dir . ',' . &rtp . ',' . global_dir . 'after'
|
||||
exe 'source ' . custom_glob_conf
|
||||
else
|
||||
if has('timers')
|
||||
|
Loading…
Reference in New Issue
Block a user