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

Add spacevim option for vimfiler colums

This commit is contained in:
wsdjeg 2017-04-03 19:32:19 +08:00
parent 3aaeb9a910
commit d63d25a953
3 changed files with 43 additions and 19 deletions

View File

@ -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']

View File

@ -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()

View File

@ -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.