Sublime Forum

FileBrowser Package Customization

#1

Hello fellow sublimers, I am having a bit of issue trying to setup file icons to work with FileBrowser package which is essentially a replicate for file browsing such as nvim or emacs editors, and it allows you to go through your whole tree structure at any given time and it is not fixed in some sense like the default sublime tree which basically allows you to preview files only that are inside the folder you have opened and are working in, but this allows you to see the whole structure, your whole file explorer or finder.

I want to get the icons working and I have no success so far, to demonstrate what I mean I will post an image here, so basically I have my own file icons which I customized to work with the default sublime side tree view and it looks great but now I want to expand it to this file browser package and I dont have any luck whatsoever, and I was wondering if somebody is using this package and maybe knows how to set it up.


This image showcases the default tree view sidebar in sublime and you can see I have these icons there, and then in the middle you can see this FileBrowser package which I am trying to setup, which doesnt have those icons.

So if anybody has any idea or any clue please share your thoughts. Thanks :smiley:

0 Likes

#2

I don’t think this is implemented as these views are text-only IIRC. If we were to support icons we would need to draw them – in a text buffer, probably using phantoms or so. I don’t remember seeing such code in the plugin.

0 Likes

#3

Aha I see, well I am thinking off giving it a try and tinkering with this, I find the filebrowser to be much more superior than using only the defualt sidebar in sublime and I am really missing the icons I think they are a great addition to this package so I might give it a shot.

I already made some small function script in .py for toggling and made it work so I am interested to see if this can be done.

0 Likes

#4

Maybe instead of .png-icons and phantoms, a nerd-font with icons (just like in the Terminal) would make more sense.

0 Likes

#5

Yeah maybe I will give that a try, I was thinking of looking up how the nvim or emacs generates theirs because they are using some terminal look alike, so maybe I will see what can be done on that behalf.

0 Likes

#6

I managed to get it working, editing the file of the package itself and adding the Nerd Fonts like you said and somehow it actually worked. This look awesome now, I will still tweak it a bit and make it be a bit cooler so not just one colored and so forth:

So it was actually a great idea to think of the Nerd Font to use, would not have thought of that, thanks for the insight :smile:

EDIT: Nevermind it is not fully functional, it displays things in wrong order so I need to fix that and also it sometimes reverts back to old look so I have to see how and why this happens, will let you know if I figure it out. :frowning_face:

0 Likes

#7

Okay I finally managed to fix it and make the icons stop from reverting, make the RENAME MODE work as well because it wasnt, it wasnt renaming in a sense that it would revert to the old icons and so forth, I need to fix like a lot of methods and it took a loooot of time to see what was happening and what was being triggered and all. Namely what gave the problem away was that whenever you would move the caret from the filebrowser panel and then would go back to it later the icons would revert, I knew it had something to do with the packacge refreshing them all over again or something and I did find such thing but only later…

Anyways If anyone is interested ever in doing this I can provide the code for the icons because it requires a lot of the methods to be modified.

0 Likes