-
Notifications
You must be signed in to change notification settings - Fork 266
Usage
If you installed and setup things correctly you should now see icons in the supported plugins!
Notes on include order:
- for support of these plugins: NERDTree, vim-airline, CtrlP, powerline, Denite, unite, vimfiler, flagship you must configure vim to load those plugins before vim-devicons loads.
- for better nerdtree-git-plugin support, you should configure vim to load nerdtree-git-plugin before VimDevIcons loads.
- if you are lazy loading Denite using the Dein plugin manager, you will need to source VimDevIcons before Denite loads.
Lightline Setup and Powerline Setup require some extra setup as shown below:
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
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
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
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
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
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
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
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
- Note this is for the current Powerline not the deprecated vim-powerline
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
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
This Wiki and the Readme contain a lot of information, please take your time to read the information.
If you run into any trouble, please start by looking in the FAQ.
There are very detailed Changelog and Release changes available.
Be sure to read the Contributing Guide before opening a pull request to Nerd Fonts.
-
Vote for VimDevIcons on vim.org