nvim-tree / nvim-web-devicons

lua `fork` of vim-web-devicons for neovim
MIT License
1.92k stars 181 forks source link

Cannot override some icons by filename #434

Closed Poly2it closed 2 months ago

Poly2it commented 2 months ago

I have tried overriding the LICENSE and README file icons by filename, but they simply don't function. How do I override these? Here is the relevant configuration:

{
    color_icons = true,
    default = false,
    strict = true,
    override_by_filename = {
        ["README"] = {
            icon = "",
            color = colors.light_2,
            name = "Readme",
        },
        ["LICENSE"] = {
            icon = "",
            color = colors.yellow_3,
            name = "License",
        },
    },
}
Poly2it commented 2 months ago

I am also unable to override the "png" icon by filetype.

Poly2it commented 2 months ago

Sometimes I also have to restart Neovim as some icons in the table are not applied at random.

Poly2it commented 2 months ago

There were no configuration changes between the capturings of these two screenshots. example_1 example_0

Poly2it commented 2 months ago

I wrote my own custom API-compatible icon plugin to resolve the bugs: https://github.com/Poly2it/nvim/tree/master/lua/modules/salt-icons.

alex-courtis commented 2 months ago

Are you using the lazy plugin manager? It's startup ordering is unpredictably deterministic.

Most usages of web-devicons do cache icons, hence startup order is important.

Poly2it commented 2 months ago

Are you using the lazy plugin manager? It's startup ordering is unpredictably deterministic.

Most usages of web-devicons do cache icons, hence startup order is important.

Yes, do I close as unsupported?

alex-courtis commented 2 months ago

Yes, do I close as unsupported?

In that case, try to ensure that lazy executes nvim-web-devicons setup before the other plugins that use it.

Alternatively you can try a deterministic plugin manager.

Closing, please do reply with your solution if that works for you.