Skip to content

Feature request: "blank" icon glyphs turn off all icons of that type #3134

@simonmandlik

Description

@simonmandlik
Collaborator

Is this a question?
No

Can this functionality be implemented utilising API?
No

Is your feature request related to a problem? Please describe.
I am using renderer.icons.glyphs.git on a daily basis, but the "ignore" icon seems superficial and distracting especially in repos with a lot of ignored paths.

The solution is to set renderer.icons.glyphs.git to whitespace, e.g. " ", however, when git icons are right-aligned and the longest name in nvim-tree window is ignored, this adds unnecessary whitespace to the right:

Image

Setting the icon glyph to an empty string "" doesn't solve this, because then the whole set of icons is disabled due to this condition:

-- don't use sign if not defined
if #icon.str < 1 then
self.icon_placement = "none"
return
end

Describe the solution you'd like
If the point of this condition is to only save compute, would it make sense to remove it or somehow improve the logic such that it is possible to achieve the above?

Activity

alex-courtis

alex-courtis commented on May 24, 2025

@alex-courtis
Member

I might be missing the point, however you can turn off all glyphs of a type via :help nvim-tree.renderer.icons.show

In the git case you could also turn git off via :help nvim-tree.git.enable, to save on git processing.

Is there something higher level that you're after?

simonmandlik

simonmandlik commented on May 24, 2025

@simonmandlik
CollaboratorAuthor

In my specific case, I want to use right-aligned git icons. They are very useful, so turning off all glyphs or git processing is out of the question.

However, I want to display only a specific subset of glyphs. In my case, I want to display all glyphs except the "ignore" one. Another usecase I can think of is if someone want to display e.g. only error and warn diagnostics and not the rest.

Currently, for right-aligned icons this is only possible to achieve by setting these unwanted glyphs to non-empty whitespace, " ". If I set them to empty string "", the above mentioned condition fires and disables all glyphs of given type.

alex-courtis

alex-courtis commented on May 25, 2025

@alex-courtis
Member

However, I want to display only a specific subset of glyphs. In my case, I want to display all glyphs except the "ignore" one. Another usecase I can think of is if someone want to display e.g. only error and warn diagnostics and not the rest.

I see! That would be rather useful for other cases e.g. diagnostic hint icon.

I'd be really grateful if you implemented this one. There's no breakages to worry about as we've not specified current behaviour in the documentation.

added
PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated
on May 25, 2025
added a commit that references this issue on May 25, 2025
8e89a6a
added a commit that references this issue on May 26, 2025

fix(#3134): setting one glyph to "" no longer disables others (#3136)

ebcaccd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @alex-courtis@simonmandlik

      Issue actions

        Feature request: "blank" icon glyphs turn off all icons of that type · Issue #3134 · nvim-tree/nvim-tree.lua