ryanoasis / vim-devicons

Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
MIT License
5.63k stars 264 forks source link

NERDTree icons all pink OR with square brackets if I change color. #439

Open ubaldot opened 2 years ago

ubaldot commented 2 years ago

Required Info

NERDTree icons are all pink OR with square brackets if I change color.

According to the documentation, I have added the following lines to my .vimrc


function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd FileType nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd FileType nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction

au VimEnter * call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
au VimEnter * call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('py', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515') 
au VimEnter * call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515') 
au VimEnter * call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515') 
au VimEnter * call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515') 
au VimEnter * call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515') 
... 

but I got the square brackets in the file types for which I have changed color (see screenshot below).

As per documentation, :echo g:webdevicons_conceal_nerdtree_brackets returns 1.

Optional Info

image

igbanam commented 6 months ago

I'm having this problem as well. Whenever I re-source $MYVIMRC — which has a colorscheme line in it — even though the color stays the same, the icons render with square brackets around them.