Skip to content

Commit 5238f10

Browse files
committed
Update readme
1 parent 0454897 commit 5238f10

File tree

1 file changed

+42
-8
lines changed

1 file changed

+42
-8
lines changed

README.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# vim-nerdtree-syntax-highlight
2-
This adds syntax for nerdtree on most common file extensions. This is intended to be used with [vim-devicons](https://github.com/ryanoasis/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.
2+
This adds syntax for nerdtree on most common file extensions. Wether you want to easily see what is going on a new project, or trying to learn a new framework with a different folder structure, or just trying to make your vim look like it is 2016, this plugin can help you. This is intended to be used with [vim-devicons](https://github.com/ryanoasis/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.
33

44
File syntax will follow this pattern:
55

6-
* labels: nerdtreeFileExtensionLabel_#{extension}
7-
* icons(needs [vim-devicons](https://github.com/ryanoasis/vim-devicons)): nerdtreeFileExtensionLabel_#{extension}
6+
| @ | label | icon |
7+
|---| --- | --- |
8+
|file extensions|nerdtreeFileExtensionLabel_#{extension}|nerdtreeFileExtensionIcon_#{extension}|
9+
|exact match|nerdtreeExactMatchLabel_#{name}|nerdtreeExactMatchIcon_#{name} |
10+
|pattern match |nerdtreePatternMatchLabel_#{pattern_letters}|nerdtreePatternMatchIcon_#{pattern_letters}|
811

912
### Screenshots:
1013
![](/screenshots/allfiles.png "All files generated with the generateFiles<span></span>.sh script")
1114
![](/screenshots/railsapp.png "Screenshot of files in a rails app with my current icons setup")
1215

13-
### Instalation:
16+
### Installation:
1417
##### [neobundle.vim](https://github.com/Shougo/neobundle.vim) :
1518
add this line to your .vimrc or neovim configuration file (usually it is in '~/.config/nvim/init.vim'):
1619
```vim
@@ -22,15 +25,46 @@ This plugin is intended to be used with [vim-devicons](https://github.com/ryanoa
2225
* Disable Highlighting
2326
```vim
2427
let g:NERDTreeDisableFileExtensionHighlight = 1
28+
let g:NERDTreeDisableExactMatchHighlight = 1
29+
let g:NERDTreeDisablePatternMatchHighlight = 1
2530
```
2631
* Highlight full name (not only icons). You need to add this if you don't have [vim-devicons](https://github.com/ryanoasis/vim-devicons) and want highlight.
2732
```vim
2833
let g:NERDTreeFileExtensionHighlightFullName = 1
34+
let g:NERDTreeExactMatchHighlightFullName = 1
35+
let g:NERDTreePatternMatchHighlightFullName= 1
2936
```
3037
* Customizing colors
3138
```vim
32-
let g:NERDTreeExtensionHighlightColor = {} "this line is needed to avoid error
33-
let g:NERDTreeExtensionHighlightColor['css'] = '00FF00' "sets the color of .css files to green
39+
" you can add these colors to your .vimrc to help customizing
40+
let s:brown = "905532"
41+
let s:aqua = "3AFFDB"
42+
let s:blue = "689FB6"
43+
let s:darkBlue = "44788E"
44+
let s:purple = "834F79"
45+
let s:lightPurple = "834F79"
46+
let s:red = "AE403F"
47+
let s:beige = "F5C06F"
48+
let s:yellow = "F09F17"
49+
let s:orange = "D4843E"
50+
let s:darkOrange = "F16529"
51+
let s:pink = "CB6F6F"
52+
let s:salmon = "EE6E73"
53+
let s:green = "8FAA54"
54+
let s:lightGreen = "31B53E"
55+
let s:white = "FFFFFF"
56+
let s:rspec_red = 'FE405F'
57+
let s:git_orange = 'F54D27'
58+
59+
let g:NERDTreeExtensionHighlightColor = {} " this line is needed to avoid error
60+
let g:NERDTreeExtensionHighlightColor['css'] = s:blue " sets the color of .css files to blue
61+
62+
let g:NERDTreeExactMatchHighlightColor = {} " this line is needed to avoid error
63+
let g:NERDTreeExactMatchHighlightColor['.gitignore'] = s:git_orange
64+
65+
let g:NERDTreePatternMatchHighlightColor = {} " this line is needed to avoid error
66+
let g:NERDTreePatternMatchHighlightColor['.*_spec.rb'] = s:rspec_red
67+
3468
```
3569

3670
* Disable Highlight for specific file extension
@@ -40,5 +74,5 @@ let g:NERDTreeExtensionHighlightColor['css'] = '' "assigning it to an empty stri
4074
```
4175

4276
Obs: If you have [vim-devicons](https://github.com/ryanoasis/vim-devicons) and you want to customize icons you can customize your icons for each file type.
43-
### generateFiles script
44-
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.
77+
### generate_files.sh script
78+
There is a script folder called generate_files.sh that will generate all the files supported by this plugin by default for a quick review. These files will be generated on a 'files' subfolder.

0 commit comments

Comments
 (0)