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.64k stars 267 forks source link

The color of folder icon changed #250

Open glepnir opened 5 years ago

glepnir commented 5 years ago

Hi,today i update the vim-devicons.but i found the color of folder has been changed.this is updated image 22 before update 11

This is my setting

let g:WebDevIconsOS = 'Darwin'
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:DevIconsEnableFoldersOpenClose = 1
let g:DevIconsEnableFolderExtensionPatternMatching = 1
xguerin commented 5 years ago

Seeing the same behavior:

screen shot 2018-11-13 at 11 39 19 am
KostyaEsmukov commented 5 years ago

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.

See https://github.com/scrooloose/nerdtree/issues/918

glepnir commented 5 years ago

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.

See scrooloose/nerdtree#918

Thanks ,I cut back to the normal version of the past, I will not upgrade for the time being, I will try your way.

KostyaEsmukov commented 5 years ago

@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.

kutsan commented 5 years ago

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.

glepnir commented 5 years ago

Looking forward to solving

cj commented 5 years ago

I personally really like the new folder color and would be sad to see it gone. They should just make it a config option.

kutsan commented 5 years ago
highlight! link NERDTreeFlags NERDTreeDir

solves the problem for me. What do you guys think?

KostyaEsmukov commented 5 years ago

@kutsan this works for me as well.

Do you have any idea where does the new orange color comes from?

kutsan commented 5 years ago

@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.

KostyaEsmukov commented 5 years ago

@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.

kutsan commented 5 years ago

@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.

ryanoasis commented 5 years ago

This is an interesting one, I am still catching up. I would be open to having some configuration (if possible)..

PhilRunninger commented 5 years ago

@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
ryanoasis commented 5 years ago

Thanks for the follow-up @PhilRunninger

ryanoasis commented 4 years ago

@glepnir This is still an issue or are you saying one of the workarounds solved it for you? Thanks

glepnir commented 4 years ago

@ryanoasis sorry for close.

Goku-San commented 4 years ago

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.

Goku-San commented 4 years ago

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.

tiagofumo commented 4 years ago

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.

get-me-power commented 4 years ago

@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

her commented 4 years ago

I think we should actually document highlight groups.

Directories are highlighted by coloring NERDTreeDir Files are highlighted by coloring NERDTreeFlags

get-me-power commented 4 years ago

@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.