diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 18ca57716..31985a8ab 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -273,6 +273,12 @@ let g:spacevim_lint_on_save = 1 " let g:spacevim_enable_vimfiler_welcome = 0 " < let g:spacevim_enable_vimfiler_welcome = 1 +"" +" Enable/Disable gitstatus colum in vimfiler buffer, default is 0. +let g:spacevim_enable_vimfiler_gitstatus = 0 +"" +" Enable/Disable filetypeicon colum in vimfiler buffer, default is 0. +let g:spacevim_enable_vimfiler_filetypeicon = 0 let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default'] let g:spacevim_smartcloseignoreft = ['help'] let g:spacevim_altmoveignoreft = ['Tagbar' , 'vimfiler'] diff --git a/config/plugins/vimfiler.vim b/config/plugins/vimfiler.vim index 84ee0077d..22ae5b980 100644 --- a/config/plugins/vimfiler.vim +++ b/config/plugins/vimfiler.vim @@ -23,25 +23,37 @@ if has('mac') else let g:vimfiler_quick_look_command = 'gloobus-preview' endif -try - call vimfiler#custom#profile('default', 'context', { - \ 'explorer' : 1, - \ 'winwidth' : g:spacevim_sidebar_width, - \ 'winminwidth' : 30, - \ 'toggle' : 1, - \ 'auto_expand': 1, - \ 'direction' : 'rightbelow', - \ 'explorer_columns' : 'filetypeicon', - \ 'parent': 0, - \ 'status' : 1, - \ 'safe' : 0, - \ 'split' : 1, - \ 'hidden': 1, - \ 'no_quit' : 1, - \ 'force_hide' : 0, - \ }) -catch -endtry +function! s:setcolum() abort + if g:spacevim_enable_vimfiler_filetypeicon && !g:spacevim_enable_vimfiler_gitstatus + return 'filetypeicon' + elseif !g:spacevim_enable_vimfiler_filetypeicon && g:spacevim_enable_vimfiler_gitstatus + return 'gitstatus' + elseif g:spacevim_enable_vimfiler_filetypeicon && g:spacevim_enable_vimfiler_gitstatus + return 'filetypeicon:gitstatus' + else + return '' + endif +endfunction +"try +call vimfiler#custom#profile('default', 'context', { + \ 'explorer' : 1, + \ 'winwidth' : g:spacevim_sidebar_width, + \ 'winminwidth' : 30, + \ 'toggle' : 1, + \ 'auto_expand': 1, + \ 'direction' : 'rightbelow', + \ 'explorer_columns' : s:setcolum(), + \ 'parent': 0, + \ 'status' : 1, + \ 'safe' : 0, + \ 'split' : 1, + \ 'hidden': 1, + \ 'no_quit' : 1, + \ 'force_hide' : 0, + \ }) + +"catch +"endtry augroup vfinit au! autocmd FileType vimfiler call s:vimfilerinit() diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index f61899bd3..507519feb 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -296,6 +296,12 @@ vim to start up slowly if there are too many files in the current directory. let g:spacevim_enable_vimfiler_welcome = 0 < + *g:spacevim_enable_vimfiler_gitstatus* +Enable/Disable gitstatus colum in vimfiler buffer, default is 0. + + *g:spacevim_enable_vimfiler_filetypeicon* +Enable/Disable filetypeicon colum in vimfiler buffer, default is 0. + *g:spacevim_hosts_url* The host file url. This option is for Chinese users who can not use Google and Twitter.