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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding base colors from config.fish #138

Closed
abeintopalo opened this issue Feb 6, 2019 · 4 comments
Closed

Overriding base colors from config.fish #138

abeintopalo opened this issue Feb 6, 2019 · 4 comments
Labels
馃悰 bug something that doesn't works as expected

Comments

@abeintopalo
Copy link

Hi,

Thank you for this great prompt, I love it. 馃憤
I'm using iTerm2 with solarized dark theme. It seems that brblack color is not visible on iTerm2's background. I would like to override pure_color_gray so that all dependent variable is overriden as well.
So far this is my config.fish file:

set DIR (dirname (status --current-filename))

source $DIR"/.aliases"
source $DIR"/.variables"

# override pure theme gray color to be compatible with solarized dark theme of iTerm2
set -g pure_color_gray (set_color yellow)
source "$DIR"/conf.d/pure.fish

Unfortunately this doesn't work because under the hood pure.fish uses _pure_set_default which checks if a variable is already set or not.
The idea is that I don't want to override all the pure_color_gray dependent variables one by one.
Is there a way to achieve this?

@andreiborisov andreiborisov added the 馃悰 bug something that doesn't works as expected label Feb 6, 2019
@edouard-lopez
Copy link
Member

Does it happen after terminating all your fish session?

Did you try to erase all dependent variables before sourcing conf.d/pure.fish?

set --erase pure_color_git_branch

@abeintopalo
Copy link
Author

Yes it happens after terminating all my fish sessions i.e. restarting my iTerm2.

Erasing all dependent variables does the job.
However, I thought it would be nice to have a solution that works without checking pure.fish to see what are the dependent variables and erase them one by one before sourcing conf.d/pure.fish.

Otherwise any update to pure that would introduce new dependent variables wouldn't be updated automatically with that solution.

@edouard-lopez
Copy link
Member

Explicit erasing or overriding is not ideal, I agree.

But I reckon the config is loaded before you source the conf.d/pure.fishotherwise it should not be needed to erase them. If so you could try to erase all pure_color_* using a loop.

Sorry I haven't tested this as I'm on my phone

@abeintopalo
Copy link
Author

I solved it based on your suggestion:

set DIR (dirname (status --current-filename))

source $DIR"/.aliases"
source $DIR"/.variables"

# clear previously set color variables
for color_variable in (set -n | grep -e pure_color_)
    set -e $color_variable
end

# override pure theme gray color to be compatible with solarized dark theme of iTerm2
set -g pure_color_gray (set_color yellow)

source "$DIR"/conf.d/pure.fish

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃悰 bug something that doesn't works as expected
Projects
None yet
Development

No branches or pull requests

3 participants