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

Improve setting of vimfiler

fix #495
fix #496
This commit is contained in:
wsdjeg 2017-05-11 21:44:43 +08:00
parent 1923e9b383
commit 914f218efb
4 changed files with 28 additions and 21 deletions

View File

@ -502,13 +502,6 @@ function! SpaceVim#welcome() abort
if exists('g:_spacevim_checking_flag') && g:_spacevim_checking_flag
return
endif
let f = ''
if argc()
let f = expand(argv(0))
if isdirectory(f)
exe 'lcd ' . f
endif
endif
if exists(':Startify') == 2
Startify
endif
@ -517,9 +510,6 @@ function! SpaceVim#welcome() abort
if exists(':VimFiler') == 2
VimFiler
wincmd p
elseif exists(':NERDTreeToggle') == 2
NERDTreeToggle
wincmd p
endif
endif
endfunction

View File

@ -70,20 +70,10 @@ function! SpaceVim#autocmds#init() abort
autocmd FocusGained * call s:reload_touchpad_status()
endif
autocmd BufWritePost *.vim call s:generate_doc()
autocmd VimEnter * if !s:with_file() | call SpaceVim#welcome() | endif
autocmd ColorScheme gruvbox call s:fix_gruvbox()
augroup END
endfunction
function! s:with_file() abort
if !argc()
return 0
elseif isdirectory(expand(argv(0)))
return 0
else
return 1
endif
endfunction
function! s:reload_touchpad_status() abort
if s:touchpadoff
call s:disable_touchpad()

View File

@ -73,7 +73,7 @@ function! SpaceVim#layers#unite#plugins() abort
endif
if g:spacevim_filemanager ==# 'vimfiler'
call add(plugins, ['Shougo/vimfiler.vim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1}])
call add(plugins, ['Shougo/vimfiler.vim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1, 'on_cmd' : 'VimFiler'}])
endif
return plugins
endfunction

View File

@ -1,5 +1,32 @@
let g:Config_Main_Home = fnamemodify(expand('<sfile>'), ':p:h:gs?\\?'.((has('win16') || has('win32') || has('win64'))?'\':'/') . '?')
" [dir?, path]
function! s:parser_argv() abort
if !argc()
return [1, getcwd()]
elseif argv(0) =~# '/$'
let f = expand(argv(0))
if isdirectory(f)
return [1, f]
else
return [1, getcwd()]
endif
elseif isdirectory(expand(argv(0)))
return [1, expand(argv(0)) ]
else
return [0]
endif
endfunction
let s:status = s:parser_argv()
if s:status[0]
exe 'cd ' . s:status[1]
augroup SPwelcom
au!
autocmd VimEnter * call SpaceVim#welcome()
augroup END
endif
try
call zvim#util#source_rc('functions.vim')
catch