1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:50:06 +08:00

Add icons and git status to defx. (#3320)

This commit is contained in:
Dennis Rausch 2020-02-01 22:52:44 -06:00 committed by GitHub
parent d28e905c8d
commit acf40eae71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -27,6 +27,8 @@ function! SpaceVim#layers#core#plugins() abort
call add(plugins, ['Shougo/vimproc.vim', {'build' : [(executable('gmake') ? 'gmake' : 'make')]}])
elseif g:spacevim_filemanager ==# 'defx'
call add(plugins, ['Shougo/defx.nvim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1}])
call add(plugins, ['kristijanhusak/defx-git',{'merged' : 0, 'loadconf' : 1}])
call add(plugins, ['kristijanhusak/defx-icons',{'merged' : 0}])
endif
if !g:spacevim_vimcompatible

View File

@ -0,0 +1,10 @@
let g:defx_git#indicators = {
\ 'Modified' : '•',
\ 'Staged' : '✚',
\ 'Untracked' : 'ᵁ',
\ 'Renamed' : '≫',
\ 'Unmerged' : '≠',
\ 'Ignored' : 'ⁱ',
\ 'Deleted' : '✖',
\ 'Unknown' : '⁇'
\ }

View File

@ -14,7 +14,20 @@ else
let s:direction = 'leftabove'
endif
function! s:setcolum() abort
if g:spacevim_enable_vimfiler_filetypeicon && !g:spacevim_enable_vimfiler_gitstatus
return 'indent:icons:filename:type'
elseif !g:spacevim_enable_vimfiler_filetypeicon && g:spacevim_enable_vimfiler_gitstatus
return 'indent:icons:filename:type'
elseif g:spacevim_enable_vimfiler_filetypeicon && g:spacevim_enable_vimfiler_gitstatus
return 'indent:git:icons:filename:type'
else
return 'mark:indent:icon:filename:type'
endif
endfunction
call defx#custom#option('_', {
\ 'columns': s:setcolum(),
\ 'winwidth': g:spacevim_sidebar_width,
\ 'split': 'vertical',
\ 'direction': s:direction,