Open glepnir opened 5 years ago
Seeing the same behavior:
Apparently this is caused by https://github.com/scrooloose/nerdtree/commit/6fe967b3b357c50c74ca25a3840a66b705593bce.
As a quick fix I did the following (this is for vim-plug):
Plug 'scrooloose/nerdtree', { 'commit': '8d005db' }
and then ran PlugUpdate
.
Apparently this is caused by scrooloose/nerdtree@6fe967b.
As a quick fix I did the following (this is for vim-plug):
Plug 'scrooloose/nerdtree', { 'commit': '8d005db' }
and then ran
PlugUpdate
.
Thanks ,I cut back to the normal version of the past, I will not upgrade for the time being, I will try your way.
@MagnusHuan could you please reopen this issue?
I believe this is not resolved yet, even though that the root cause is in the nerdtree itself, it directly affects this plugin.
I believe this is not resolved yet, even though that the root cause is in the nerdtree itself, it directly affects this plugin.
I agree and I reopened.
Looking forward to solving
I personally really like the new folder color and would be sad to see it gone. They should just make it a config option.
highlight! link NERDTreeFlags NERDTreeDir
solves the problem for me. What do you guys think?
@kutsan this works for me as well.
Do you have any idea where does the new orange color comes from?
@KostyaEsmukov
Do you have any idea where does the new orange color comes from?
It comes from here. Basically, additional flags belong to Number
highlight group and since directory names have its own Directory
highlight group, highlight! link NERDTreeFlags NERDTreeDir
links icon colors with directory colors.
@kutsan
Thanks, that makes sense.
I don't understand exactly the implications of your solution (i.e. how would that affect files having something matching the NERDTreeFlags
group in front of them and other vim plugins which prepend stuff to the nerdtree items); but I, personally, don't see any difference in coloring with how it was before that regression.
There are no updates in scrooloose/nerdtree#918 so I guess that this won't be fixed on nerdtree's side anytime soon.
It would be nice to have it fixed in this plugin or, if you believe that messing with highlights on behalf of users is bad, to have it documented at least.
@KostyaEsmukov
To be honest, I haven't tested it (and read the source of NERDTree) that much but I don't think that'll cause any problem for you. It'll work as it used to be.
It would be nice to have it fixed in this plugin or, if you believe that messing with highlights on behalf of users is bad, to have it documented at least.
Although, it says I'm a Collaborator
, still this is something Ryan needs to decide on. But I think we should wait a little bit more to see what they will say about scrooloose/nerdtree#918.
This is an interesting one, I am still catching up. I would be open to having some configuration (if possible)..
@ryanoasis, let me shed some light on this, now that I'm looking at this again.
The commit in question - https://github.com/scrooloose/nerdtree/commit/6fe967b3b357c50c74ca25a3840a66b705593bce - fixed an oversight in NERDTree. There is a syntax group named NERDTreeFlags
that was originally looking for only one character between the brackets, while it was always possible to have multiple flags. Before the commit, when multiple flags were in play, the match wouldn't find anything, and highlighting would revert to the file's or directory's. After the commit, those multi-character flags could be found, and would be colored according to the NERDTreeFlags
' highlighting.
I think the easiest, and most correct, solution would be to have vim-devicons
clear the NERDTreeFlags syntax group. That way it would be correct for NERDTree-only users, and vim-devicons users would again see the coloring they were used to, where the flags match the filetype. Since people have chimed in on both sides of the issue with respect to the new colors, you could add an option to enable or disable this clearing; I'll leave that up to you.
The DIY solution to this would be to create a file named ~/.vim/after/syntax/nerdtree.vim
, and add this line to it:
syntax clear NERDTreeFlags
Thanks for the follow-up @PhilRunninger
@glepnir This is still an issue or are you saying one of the workarounds solved it for you? Thanks
@ryanoasis sorry for close.
Hello, I just updated vim plugins through vim-plug, and I noticed the same behaviour. The icons are all red colored and when I applied the @PhilRunninger solution the folders were blue, the icons had their corresponding color, but there were brackets as well, although I have them disabled. So how do I solve this ?? Thanks in advance.
Hello @ryanoasis @ryanbyon and all the other in this discussion
I just made a workaround for this issue, rather I found one :) And there is no brackets. Works for vim and Gvim on my end.
Check my repo
I hope this issue gets fixed soon.
Folder and file icons are by default in NERDTreeFlags, which is using same color as Constant, so depending of your color scheme you will see different colors. If you change the color for NERDTreeFlags you will have the same color for folder icons and file icons, which some people might not want. I added syntax for these with my plugin vim-nerdtree-syntax-highlight. It wil now use the same color as the labels for files and folders that do not match another color rule. You can disable this, and also set your custom color.
@tiagofumo Thank you for your kind explanation!
Now, I think it's better to mention about vim-nerdtree-syntax-highlight
in the README or the documentation.
What do you think? @her @ryanoasis
I think we should actually document highlight groups.
Directories are highlighted by coloring NERDTreeDir
Files are highlighted by coloring NERDTreeFlags
@her
What you say makes sense.
You might also mention a plugin that allows you to change the color of the icon, (like vim-nerdtree-syntax-highlight
, for example). The user can choose any color they want use these plugins.
Hi,today i update the vim-devicons.but i found the color of folder has been changed.this is updated image before update
This is my setting