1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 12:10:05 +08:00

Fix custom config (#1779)

This commit is contained in:
Wang Shidong 2018-06-02 16:26:58 +08:00 committed by GitHub
parent b4863f695b
commit 7eb600aef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

@ -80,11 +80,19 @@ endfunction
" @vimlint(EVL103, 0, a:CursorPos)
function! SpaceVim#commands#config(...) abort
if (a:0 > 0 && a:1 ==# '-g') || a:0 == 0
if a:0 > 0
if a:1 ==# '-g'
exe 'tabnew' g:_spacevim_global_config_path
elseif a:0 > 0 && a:1 ==# '-l'
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
endfunction
function! SpaceVim#commands#update_plugin(...) abort

View File

@ -121,7 +121,7 @@ endfunction
function! SpaceVim#custom#load() abort
" if file .SpaceVim.d/init.toml exist
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 local_conf = fnamemodify('.SpaceVim.d/init.toml', ':p')
call SpaceVim#logger#info('find config file: ' . local_conf)
@ -141,7 +141,7 @@ function! SpaceVim#custom#load() abort
call s:load_glob_conf()
endif
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
exe 'source .SpaceVim.d/init.vim'
if g:spacevim_force_global_config