mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-14 15:19:12 +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
|
function! s:global_dir() abort
|
||||||
if empty($SPACEVIMDIR)
|
if empty($SPACEVIMDIR)
|
||||||
return s:FILE.unify_path('~/.SpaceVim.d/')
|
return s:FILE.unify_path('~/.SpaceVim.d/')
|
||||||
else
|
else
|
||||||
return s:FILE.unify_path($SPACEVIMDIR)
|
return s:FILE.unify_path($SPACEVIMDIR)
|
||||||
endif
|
endif
|
||||||
@ -183,8 +183,9 @@ endfunction
|
|||||||
function! SpaceVim#custom#load() abort
|
function! SpaceVim#custom#load() abort
|
||||||
" if file .SpaceVim.d/init.toml exist
|
" if file .SpaceVim.d/init.toml exist
|
||||||
if filereadable('.SpaceVim.d/init.toml')
|
if filereadable('.SpaceVim.d/init.toml')
|
||||||
let g:_spacevim_config_path = s:CMP.resolve(fnamemodify('.SpaceVim.d/init.toml', ':p'))
|
let local_dir = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d/', ':p:h')))
|
||||||
let &rtp = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d', ':p:h'))) . ',' . &rtp
|
let g:_spacevim_config_path = local_dir . 'init.toml'
|
||||||
|
let &rtp = local_dir . ',' . &rtp . ',' . local_dir . 'after'
|
||||||
let local_conf = g:_spacevim_config_path
|
let local_conf = g:_spacevim_config_path
|
||||||
call SpaceVim#logger#info('find local conf: ' . local_conf)
|
call SpaceVim#logger#info('find local conf: ' . local_conf)
|
||||||
let local_conf_cache = s:path_to_fname(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()
|
call s:load_glob_conf()
|
||||||
endif
|
endif
|
||||||
elseif filereadable('.SpaceVim.d/init.vim')
|
elseif filereadable('.SpaceVim.d/init.vim')
|
||||||
let g:_spacevim_config_path = fnamemodify('.SpaceVim.d/init.vim', ':p')
|
let local_dir = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d/', ':p:h')))
|
||||||
let &rtp = s:FILE.unify_path(s:CMP.resolve(fnamemodify('.SpaceVim.d', ':p:h'))) . ',' . &rtp
|
let g:_spacevim_config_path = local_dir . 'init.vim'
|
||||||
|
let &rtp = local_dir . ',' . &rtp . ',' . local_dir . 'after'
|
||||||
let local_conf = g:_spacevim_config_path
|
let local_conf = g:_spacevim_config_path
|
||||||
call SpaceVim#logger#info('find local conf: ' . local_conf)
|
call SpaceVim#logger#info('find local conf: ' . local_conf)
|
||||||
exe 'source .SpaceVim.d/init.vim'
|
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 g:_spacevim_global_config_path = global_dir . 'init.toml'
|
||||||
let local_conf = 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 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))
|
if getftime(resolve(local_conf)) < getftime(resolve(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, ''), ''))
|
||||||
call SpaceVim#custom#apply(conf, 'glob')
|
call SpaceVim#custom#apply(conf, 'glob')
|
||||||
@ -244,7 +246,7 @@ function! s:load_glob_conf() abort
|
|||||||
elseif filereadable(global_dir . 'init.vim')
|
elseif filereadable(global_dir . 'init.vim')
|
||||||
let g:_spacevim_global_config_path = global_dir . 'init.vim'
|
let g:_spacevim_global_config_path = global_dir . 'init.vim'
|
||||||
let custom_glob_conf = 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
|
exe 'source ' . custom_glob_conf
|
||||||
else
|
else
|
||||||
if has('timers')
|
if has('timers')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user