1

I've just installed plugins for my Neovim using vim-plug.  The plugins are working perfectly, but it's the icons within them that are haunting me.  I've provided screenshots of them below.

NERDTree:
NERDTree

vim-airline:
vim-airline

They look very weird and it's hard to use.  Here's what I've tried:

I am using Debian Linux AMD64.

2 Answers 2

2

It is a very common problem with many users after their very first installation of vim-airline plugin. So here are a few steps you have to carry out to see the icons in the vim-airline as well as in the NERDTree plugin.

Step 1

Install vim-devicons https://github.com/ryanoasis/vim-devicons using any plugin manager (I prefer vim-plug for this. https://github.com/junegunn/vim-plug) and place it just before the call plug#end() command or try to load this plugin at the end of all other plugins(if you are using any other methods to install your plugin) and at the next line paste set encoding=UTF-8 example:

call plug#begin()
.
.
.
Plug 'https://github.com/ryanoasis/vim-devicons'
set encoding=UTF-8
call plug#end()

Step 2

Paste the following code after the previous loop

let g:NERDTreeDirArrowExpandable="+"
let g:NERDTreeDirArrowCollapsible="~"

" air-line
let g:airline_powerline_fonts = 1

if !exists('g:airline_symbols')
    let g:airline_symbols = {}
endif

" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
" airline symbols                                                                                                                              
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''

let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:WebDevIconsUnicodeDecorateFolderNodeDefaultSymbol = ''

let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols = {}
let g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols['nerdtree'] = ''

Step 3

Download any of the font from https://www.nerdfonts.com/font-downloads. I prefer DejaVuSansMono Nerd Font.

Step 4

unzip DejaVuSansMono.zip and do mv ~/.fonts and cd ~/.fonts

Step 5

Finally you have to run fc-cache -fv to manually rebuild the font cache. Now reopen the vim or nvim and now you will find that the icons are visible correctly.

2
  • Its been so long and as I never found a fix I used alternatives.... Anyway thanks for your long answer I haven't checked it yet but I hope you are right so I am marking this correct Commented Apr 29, 2023 at 6:13
  • Thank you @psychoSherlock for your appreciation. Like you, I also faced the same issue and resolved as per my answer. So thought other developers will also be benifited from my research. :) Commented Aug 21, 2023 at 12:53
0

Try setting set guifont=<Your\ Nerd\ Font> in your .vimrc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .