-
Notifications
You must be signed in to change notification settings - Fork 265
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.
Lightline Setup and Powerline Setup require some extra setup as shown below:
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
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