nvim-tree.lua icon indicating copy to clipboard operation
nvim-tree.lua copied to clipboard

Set folder icon depending on it's name

Open melsiir opened this issue 2 years ago • 8 comments

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

melsiir avatar Jan 19 '22 14:01 melsiir

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

kyazdani42 avatar Feb 05 '22 11:02 kyazdani42

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

kyazdani42 avatar Feb 21 '22 23:02 kyazdani42

@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.

kraftwerk28 avatar Jul 13 '22 06:07 kraftwerk28

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

alex-courtis avatar Oct 31 '22 04:10 alex-courtis

has anyone managed to get this work?

siduck avatar Sep 15 '23 00:09 siduck

This can be done, using a regex to apply:

  • icon
  • highlight

Pull Requests are always gratefully appreciated.

alex-courtis avatar Sep 16 '23 04:09 alex-courtis

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.

yesidrs avatar Apr 11 '24 05:04 yesidrs

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

alex-courtis avatar Apr 15 '24 06:04 alex-courtis