Giter Club home page Giter Club logo

Comments (9)

n1ghtmare avatar n1ghtmare commented on July 20, 2024 2

In case someone is looking for this, here is what I did (thanks to @kyazdani42) that works just fine:

local nvim_web_devicons = require "nvim-web-devicons"

local current_icons = nvim_web_devicons.get_icons()
local new_icons = {}

for key, icon in pairs(current_icons) do
    icon.color = "#ff0088"
    icon.cterm_color = 198
    new_icons[key] = icon
end

nvim_web_devicons.set_icon(new_icons)

from nvim-web-devicons.

n1ghtmare avatar n1ghtmare commented on July 20, 2024 1

@kyazdani42 I did, sorry for the late response, I meant to open this sooner, but it slipped my mind. :)

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

you could write a method to get the list of all highlight groups that start with DevIcon and mapping the color you want to them in a loop.

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

or see #102 (comment)
and adapt the code to only change the color of the icon

from nvim-web-devicons.

n1ghtmare avatar n1ghtmare commented on July 20, 2024

@kyazdani42 Thank you this is really helpful, will see what I can do.

from nvim-web-devicons.

n1ghtmare avatar n1ghtmare commented on July 20, 2024

@kyazdani42 would you have an idea why when I go ahead and set the highlight group of a DevIcon doesn't appear to affect the icon colors of nvim-tree?

So I have a color scheme (.vim) and I'm trying to set the colors there (instead of hard coding this in my config).

If I call :hi DevIconLua guifg=#ff0088 as a command it seems to be working, but when I set it in my theme it doesn't. (if I set hi NvimTreeFolderIcon guifg=#ffffff in my theme file for example, it works). Does it have something to do with the order of things being loaded? Are the values in my theme file being overwritten perhaps?

Sorry for the newbish questions. Thanks for helping out.

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

I think it's a bug actually, nvim-web-devicons override predefined sets of colors when running the highlight while nvim-tree doesn't.
Can you try removing the exclamation mark at line 1260 in lua/nvim-web-devicons.lua and try again ? It might work. If so open a PR :)

from nvim-web-devicons.

n1ghtmare avatar n1ghtmare commented on July 20, 2024

@kyazdani42 I'm guessing you mean line 1264, which goes like this:

local highlight_command = "highlight! "..hl_group

I've tried removing the exclamation mark, but unfortunately it didn't work. :(

from nvim-web-devicons.

kyazdani42 avatar kyazdani42 commented on July 20, 2024

Could you open a new issue so we can track this properly please :) ?

from nvim-web-devicons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.