Skip to content

morristech/vim-nerdtree-syntax-highlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-nerdtree-syntax-highlight

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}

Screenshots:

Instalation:

add this line to your .vimrc or neovim configuration file (usually it is in '~/.config/nvim/init.vim'):

NeoBundle 'tiagofumo/vim-nerdtree-syntax-highlight'

Dependencies

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.

Configuration

  • 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 highlight

Obs: If you have vim-devicons and you want to customize icons you can customize your icons for each file type.

generateFiles script

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.

About

Extra syntax and highlight for nerdtree files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vim Script 82.4%
  • Shell 17.6%