Browse Source

ryanoasis/vim-devicons support

Add ryanoasis/vim-devicons support
Adelar da Silva Queiróz 7 years ago
parent
commit
0b343d37d0
1 changed files with 7 additions and 2 deletions
  1. 7 2
      plugin/bufexplorer.vim

+ 7 - 2
plugin/bufexplorer.vim

@@ -132,8 +132,8 @@ let s:originBuffer = 0
 let s:running = 0
 let s:sort_by = ["number", "name", "fullpath", "mru", "extension"]
 let s:splitMode = ""
-let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t'}
-
+let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t', "extension": ':e'}
+    
 " Setup the autocommands that handle the MRUList and other stuff. {{{2
 autocmd VimEnter * call s:Setup()
 
@@ -751,6 +751,11 @@ function! s:BuildBufferList()
 
         let line = buf.attributes." "
 
+        if exists("g:loaded_webdevicons") 
+            let line .= WebDevIconsGetFileTypeSymbol('*.'.buf.extension)
+            let line .= " "
+        endif
+
         " Are we to split the path and file name?
         if g:bufExplorerSplitOutPathName
             let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path"