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

Add ability to configure icons #490

Open
mawkler opened this issue Jun 21, 2020 · 3 comments
Open

Add ability to configure icons #490

mawkler opened this issue Jun 21, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mawkler
Copy link

mawkler commented Jun 21, 2020

Hi! It would be nice if devicon-lookup allowed for customization of the icons used for each filetype. Perhaps through a flag or a config file. This would also allow users to add icons to custom filetypes.

@coreyja
Copy link
Owner

coreyja commented Jun 23, 2020

Hey @Melkster thanks for the issue!

That's an interesting idea that I hadn't considered! Do you have any use cases you have in mind that you wouldn't mind sharing? Just curious what you were thinking

It should be possible to add some config that allows for adding custom icons. No promises when I will get to it, but I would gladly review a PR.

I'm currently thinking the best might be a cli option that can be used to specify a file that contains the mappings. Could just do the mappings as cli options too though, I don't know if I have strong feels today

@coreyja coreyja added help wanted Extra attention is needed enhancement New feature or request labels Jun 23, 2020
@mawkler
Copy link
Author

mawkler commented Jun 24, 2020

@coreyja

Do you have any use cases you have in mind

The reason I started thinking of this was because I wanted to change the default icon used in Vim by fzf.devicon.vim for Markdown files to  (U+F136) instead of the default arrow that I don't like.

Also as I mentioned, another use case is if someone would like to define an icon for their own custom filetype.

@luukvbaal
Copy link

luukvbaal commented Mar 29, 2021

@melkster If you're still interested I wrote an awk script as a plugin to nnn that could be used to achieve what you want. See jarun/nnn#927.

Hadn't considered a config file for devicon-lookup although that might have been the smarter option. Only came across this issue after writing the script. Anyways now its just an awk script which is also nice in regards to dependencies. Not sure if it could have been faster in rust but its fast enough. e.g.:

431 directories, 1463 files
tree -L 4  0.01s user 0.00s system 97% cpu 0.011 total
iconlookup  0.01s user 0.00s system 78% cpu 0.021 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants