Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simonmandlik opened this issue May 20, 2025 · 3 comments · Fixed by #3136 · May be fixed by #3120
Closed

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

simonmandlik opened this issue May 20, 2025 · 3 comments · Fixed by #3136 · May be fixed by #3120
Labels
feature request PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated

Comments

@simonmandlik
Copy link
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?

@alex-courtis
Copy link
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
Copy link
Collaborator Author

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
Copy link
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.

@alex-courtis alex-courtis added the PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated label May 25, 2025
simonmandlik added a commit that referenced this issue May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated
Projects
None yet
2 participants