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:
parent
d28e905c8d
commit
acf40eae71
@ -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
|
||||
|
10
config/plugins/defx-git.vim
Normal file
10
config/plugins/defx-git.vim
Normal file
@ -0,0 +1,10 @@
|
||||
let g:defx_git#indicators = {
|
||||
\ 'Modified' : '•',
|
||||
\ 'Staged' : '✚',
|
||||
\ 'Untracked' : 'ᵁ',
|
||||
\ 'Renamed' : '≫',
|
||||
\ 'Unmerged' : '≠',
|
||||
\ 'Ignored' : 'ⁱ',
|
||||
\ 'Deleted' : '✖',
|
||||
\ 'Unknown' : '⁇'
|
||||
\ }
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user