Usage - ryanoasis/vim-devicons GitHub Wiki

VimDevIcons - Adds Icons to Your Plugins

Usage

If you installed and setup things correctly you should now see icons in the supported plugins!

Notes on include order:

Lightline Setup and Powerline Setup require some extra setup as shown below:

NERDTree

Should work "out of the box", no particular configuration should be needed.

" Can be enabled or disabled
let g:webdevicons_enable_nerdtree = 1
" whether or not to show the nerdtree brackets around flags
let g:webdevicons_conceal_nerdtree_brackets = 1

Unite

Should work "out of the box", no particular configuration should be needed.

" Can be enabled or disabled
" adding the custom source to unite
let g:webdevicons_enable_unite = 1

Denite

Should work "out of the box", no particular configuration should be needed.

" Can be enabled or disabled
" Adding the custom source to denite
let g:webdevicons_enable_denite = 1

Vimfiler

Should work "out of the box", no particular configuration should be needed.

" Can be enabled or disabled
" adding the column to vimfiler
let g:webdevicons_enable_vimfiler = 1

CtrlP

Should work "out of the box", no particular configuration should be needed.

" Can be enabled or disabled
" add glyphs to all modes
let g:webdevicons_enable_ctrlp = 1

Airline

Should work "out of the box", no particular configuration should be needed.

" adding to vim-airline's tabline
let g:webdevicons_enable_airline_tabline = 1
" adding to vim-airline's statusline
let g:webdevicons_enable_airline_statusline = 1

Startify

Should work "out of the box", no particular configuration should be needed.

" Can be enabled or disabled
" adding to vim-startify screen
let g:webdevicons_enable_startify = 1

Lightline Setup

To add the appropriate icon to lightline, call the function WebDevIconsGetFileTypeSymbol() and/or WebDevIconsGetFileFormatSymbol() in your .vimrc. For example, you could set your sections to:

let g:lightline = {
      \ 'component_function': {
      \   'filetype': 'MyFiletype',
      \   'fileformat': 'MyFileformat',
      \ }
      \ }

function! MyFiletype()
  return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : ''
endfunction

function! MyFileformat()
  return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : ''
endfunction

Powerline Setup

To enable for Powerline some vimrc and powerline configuration changes are needed:

vimrc changes (only required if you don't already have powerline setup for vim):

set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/

" Always show statusline
set laststatus=2

" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256

powerline configuration changes:

file type segment

{
	"function": "vim_devicons.powerline.segments.webdevicons",
	"priority": 10,
	"draw_soft_divider": false,
	"after": "  "
}

file format segment

{
	"function": "vim_devicons.powerline.segments.webdevicons_file_format",
	"draw_soft_divider": false,
	"exclude_modes": ["nc"],
	"priority": 90
 }

for full example see sample file

Flagship

Should work "out of the box", no particular configuration should be needed.

" Can be enabled or disabled
" adding to flagship's statusline
let g:webdevicons_enable_flagship_statusline = 1
⚠️ **GitHub.com Fallback** ⚠️