nvim-tree.lua
nvim-tree.lua copied to clipboard
Set folder icon depending on it's name
Is there any way to set icon for folder depending on it's name that will be very useful like in vs code
this would be interesting indeed :) But not feasible atm, i'll see when refactoring the renderer.
just a side note: vscode renders svg which is not feasible in nvim-tree since a terminal renders unicode and not images.
@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.
Larger issue #1508 should cover this one, with an icon applied to the path regex.
has anyone managed to get this work?
This can be done, using a regex to apply:
- icon
- highlight
Pull Requests are always gratefully appreciated.
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.
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 https://github.com/nvim-tree/nvim-tree.lua/issues/1508#issuecomment-1938041465