mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 15:00:06 +08:00
Fix custom config (#1779)
This commit is contained in:
parent
b4863f695b
commit
7eb600aef4
@ -80,10 +80,18 @@ endfunction
|
|||||||
" @vimlint(EVL103, 0, a:CursorPos)
|
" @vimlint(EVL103, 0, a:CursorPos)
|
||||||
|
|
||||||
function! SpaceVim#commands#config(...) abort
|
function! SpaceVim#commands#config(...) abort
|
||||||
if (a:0 > 0 && a:1 ==# '-g') || a:0 == 0
|
if a:0 > 0
|
||||||
exe 'tabnew' g:_spacevim_global_config_path
|
if a:1 ==# '-g'
|
||||||
elseif a:0 > 0 && a:1 ==# '-l'
|
exe 'tabnew' g:_spacevim_global_config_path
|
||||||
exe 'tabnew' g:_spacevim_config_path
|
elseif a:1 ==# '-l'
|
||||||
|
exe 'tabnew' g:_spacevim_config_path
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
if g:spacevim_force_global_config
|
||||||
|
exe 'tabnew' g:_spacevim_global_config_path
|
||||||
|
else
|
||||||
|
exe 'tabnew' g:_spacevim_config_path
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ 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 = '.SpaceVim.d/init.toml'
|
let g:_spacevim_config_path = fnamemodify('.SpaceVim.d/init.toml', ':p')
|
||||||
let &rtp = fnamemodify('.SpaceVim.d', ':p:h') . ',' . &rtp
|
let &rtp = fnamemodify('.SpaceVim.d', ':p:h') . ',' . &rtp
|
||||||
let local_conf = fnamemodify('.SpaceVim.d/init.toml', ':p')
|
let local_conf = fnamemodify('.SpaceVim.d/init.toml', ':p')
|
||||||
call SpaceVim#logger#info('find config file: ' . local_conf)
|
call SpaceVim#logger#info('find config file: ' . local_conf)
|
||||||
@ -141,7 +141,7 @@ 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 = '.SpaceVim.d/init.vim'
|
let g:_spacevim_config_path = fnamemodify('.SpaceVim.d/init.vim', ':p')
|
||||||
let &rtp = fnamemodify('.SpaceVim.d', ':p:h') . ',' . &rtp
|
let &rtp = fnamemodify('.SpaceVim.d', ':p:h') . ',' . &rtp
|
||||||
exe 'source .SpaceVim.d/init.vim'
|
exe 'source .SpaceVim.d/init.vim'
|
||||||
if g:spacevim_force_global_config
|
if g:spacevim_force_global_config
|
||||||
|
Loading…
Reference in New Issue
Block a user