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

feat: Custom colors for file categories #235

Closed
ghost opened this issue Sep 9, 2023 · 6 comments · Fixed by #245
Closed

feat: Custom colors for file categories #235

ghost opened this issue Sep 9, 2023 · 6 comments · Fixed by #245
Labels
enhancement New feature or request features › ui good first issue Good for newcomers

Comments

@ghost
Copy link

ghost commented Sep 9, 2023

Request the ability to change colors for file categories — e.g. immediate, document, image, etc. If this feature already exists I have not been able to find it in the documentation.

Currently if you want, for instance, to change the immediate file color, you would have to separately specify it for 41 different filenames — and you would have to make changes every time a new immediate file is added.

For those of us who prefer light background, yellow is a terrible, unreadable color, and changing it individually for every immediate file is a pain.

@PThorpe92 PThorpe92 added enhancement New feature or request good first issue Good for newcomers features › ui labels Sep 9, 2023
@eggbean
Copy link

eggbean commented Sep 9, 2023

exa/eza uses the $LS_COLORS variable, so you can change the colours for any file with a dir_colors file which is used to set that variable.

eg.

.md 01;32

This will change all files with the .md extension to green (dependent on your terminal ANSI theme), but you an also use the 256 colour range or probably even 24-bit colours by now (I don't have any desire to even look into that for $LS_COLORS).

Or you can set a colour just for files called README.md like this:

*README.md 01;32

This is the current state of my dir_colors file as an example (forget the version number, as I never updated it) http://ix.io/4FQP

$ man dircolors

https://www.baeldung.com/linux/ls-output-color-files-directories

@ghost
Copy link
Author

ghost commented Sep 9, 2023

I think you missed my point. Yes, you can do that, but you have to do it for each individual file name or type in the category that gets the undesired color, and you have to update your configuration any time a new addition is made to that category. What I would like is a single code to change the color for all files of that category.

@eggbean
Copy link

eggbean commented Sep 9, 2023

There's also the $EXA_COLORS variable which overrides $LS_COLORS and has some "categories", but I cannot find the keys for them - you'll have to look at the source code.

https://the.exa.website/features/colours
https://the.exa.website/docs/colour-themes

But I stopped using $EXA_COLORS early on for files (only use it to change the colours of exa elements) as these "categories" don't include all filetypes you may come across, as this is something that continuously changes. There were many cryptography filetypes that were missing, which led me to just use dircolors, which is completely flexible, extensible and granular.

I've added quite a lot of filetypes to my already quite lengthy dircolors file - most recently .bz3 and I'll probably add .bz4 one day. The time taken for all the additions and changes using vim over the years has taken less time than this conversation.

@cafkafk cafkafk linked a pull request Sep 11, 2023 that will close this issue
@Terraphice
Copy link

Frankly it's archaic to rely on the user specifying colors for each individual file type in an ENV.

The ability to write, share, and import themes is basic functionality for most modern CLI programs that heavily involve text. (Think bat.)

+1

@PThorpe92
Copy link
Member

The ability to write, share, and import themes is basic functionality for most modern CLI programs that heavily involve text. (Think bat.)

Yeah this was some of the thought process behind #139
Hopefully after some of the bigger changes going on and features like the PR to close the issue are added 👍

@Terraphice
Copy link

Yeah this was some of the thought process behind #139 Hopefully after some of the bigger changes going on and features like the PR to close the issue are added 👍

Yeah, I used to use LSD on my Windows devices as an alternative to a MSYS Exa install, and this was definitely one of the larger parts of it that I missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request features › ui good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants