Skip to content
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

Set folder icon depending on it's name #902

Open
melsiir opened this issue Jan 19, 2022 · 10 comments
Open

Set folder icon depending on it's name #902

melsiir opened this issue Jan 19, 2022 · 10 comments
Labels
feature request PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated QOL Quality Of Life Improvement

Comments

@melsiir
Copy link

melsiir commented Jan 19, 2022

Is there any way to set icon for folder depending on it's name that will be very useful like in vs code
٢٠٢٢٠١١٩_١٦٣٠٥٩

@kyazdani42
Copy link
Member

kyazdani42 commented Feb 5, 2022

this would be interesting indeed :)
But not feasible atm, i'll see when refactoring the renderer.

@kyazdani42
Copy link
Member

just a side note: vscode renders svg which is not feasible in nvim-tree since a terminal renders unicode and not images.

@kraftwerk28
Copy link

kraftwerk28 commented Jul 13, 2022

@kyazdani42, nerdfont patch has various directory icons and lsd uses them. Though it is probably web-devicons task to resolve the icon depending on directory name.

@alex-courtis alex-courtis added the QOL Quality Of Life Improvement label Oct 31, 2022
@alex-courtis
Copy link
Member

Larger issue #1508 should cover this one, with an icon applied to the path regex.

@siduck
Copy link
Contributor

siduck commented Sep 15, 2023

has anyone managed to get this work?

@alex-courtis
Copy link
Member

This can be done, using a regex to apply:

  • icon
  • highlight

Pull Requests are always gratefully appreciated.

@alex-courtis alex-courtis reopened this Sep 16, 2023
@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 Sep 16, 2023
@yesidrs
Copy link

yesidrs commented Apr 11, 2024

So there is already a way to implement it or not yet? I am a little bit confused with the different open issues about this same topic and their answers. I think that the mere fact of being able to change the color of the folder according to its regex would be more than enough to differentiate the purpose of specific folders.

@alex-courtis
Copy link
Member

alex-courtis commented Apr 15, 2024

The highlighting and most of the renderer was recently rewritten: #2455

This funtionality should be easier to implement: implement a new Decorator for user highlights, say, DecoratorUser.

That new decorator could read some new options and apply them to icon and file names. It might be easier for the user to supply functions instead of using regexes.

See #1508 (comment)

@jugarpeupv
Copy link

@alex-courtis does it mean we can already do it? if we provide as a consumer a decorator function in the nvim-tree setup? could you provide a simple example to override the icon of a folder name?

@alex-courtis
Copy link
Member

@alex-courtis does it mean we can already do it? if we provide as a consumer a decorator function in the nvim-tree setup? could you provide a simple example to override the icon of a folder name?

Sorry, it's not been built yet. We'll get to it...

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 QOL Quality Of Life Improvement
Projects
None yet
Development

No branches or pull requests

7 participants