This adds syntax for nerdtree on most common file extensions. This is intended to be used with vim-devicons to add color to icons or entire labels, but will work without it. It is possible to disable highlight, but the syntax will still be available if you want to make something specific with it. The file icons are linked to their labels which are linked to NERDTreeFile, so it will not break anything.
File syntax will follow this pattern:
- labels: nerdtreeFileExtensionLabel_#{extension}
- icons(needs vim-devicons): nerdtreeFileExtensionLabel_#{extension}
add this line to your .vimrc or neovim configuration file (usually it is in '~/.config/nvim/init.vim'):
NeoBundle 'tiagofumo/vim-nerdtree-syntax-highlight'This plugin is intended to be used with vim-devicons and to use it you will need to add a new font from nerd-fonts to your machine so you can see the icons when using vim.
- Disable Highlighting
let g:NERDTreeDisableFileExtensionHighlight = 1- Highlight full name (not only icons). You need to add this if you don't have vim-devicons and want highlight.
let g:NERDTreeFileExtensionHighlightFullName = 1- Customizing colors
let g:NERDTreeExtensionHighlightColor = {} "this line is needed to avoid error
let g:NERDTreeExtensionHighlightColor['css'] = '00FF00' "sets the color of .css files to green- Disable Highlight for specific file extension
let g:NERDTreeExtensionHighlightColor = {} "this line is needed to avoid error
let g:NERDTreeExtensionHighlightColor['css'] = '' "assigning it to an empty string will skip highlightObs: If you have vim-devicons and you want to customize icons you can customize your icons for each file type.
There is a script in 'fileColorTest' folder called generateFiles.sh that will generate all the file extension supported by this plugin for a quick review. These files will be generated on a 'files' subfolder.

