zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.74k stars 122 forks source link

feat: themes support +2 new themes, blue and gold #550

Closed psprint closed 5 months ago

psprint commented 11 months ago

Description

I think that the theming potential behind +zinit-message should be used. All styles like {error}, {warn} (or the new {w} that includes Warning: prefix – cool idea :smile:), {pname} have their corresponding keys in ZINIT hash. I think that exporting the tabular hash data (2 columns with pairs of key/value) to a separate file is a good idea also from code cleanliness perspective.

Related Issue(s)

I'm refreshing an older PR #445, done before the color data has been refactored by @vladdoster ,

Motivation and Context

The +zinit-message function has been created with theming in mind from the start. It only felt that the styles database should first grow a little before another themes would be added. Now it seems complete, so it's a good moment of adding some themes.

The patch is very simple – it only moves the ZINIT+=( … … ) assignment to a separate file share/themes/default.zsh and then is duplicated to blue.zsh and gold.zsh and then the copies are altered to different styling. Nothing can broke…

Usage examples

ZITHEME=gold /bin/zsh
ZITHEME=blue /bin/zsh
ZITHEME=default /bin/zsh

Default theme – no changes:

Plugin installation:

2023-07-29-171944_1899x240_scrot

Wrong ice error:

2023-07-29-171909_1893x234_scrot

New "Blue" theme:

Plugin installation:

2023-07-29-172042_1905x241_scrot

Wrong ice error:

2023-07-29-172013_1902x229_scrot

New "Gold" theme:

Plugin installation:

2023-07-29-172128_1900x257_scrot

Wrong ice error:

2023-07-29-172105_1905x228_scrot

How Has This Been Tested?

Like the Usage examples section.

Types of changes

Checklist:

psprint commented 11 months ago

@vladdoster @pschmitt @alichtman: ping? are you guys on vacation? ;)

psprint commented 11 months ago

@alichtman: you seem to be the only active maintainer. Could you merge this straightforward, harmless patch?

alichtman commented 10 months ago

I'd ping @vladdoster. I haven't merged any real code to this ever, really. Don't have time / bandwidth to be a "good" maintainer

psprint commented 10 months ago

Ping @vladdoster then. The patch is harmless, could you merge?

psprint commented 10 months ago

@vladdoster: Hi. What holds you before merging this PR?

vladdoster commented 10 months ago

@psprint,

This is cool, but I'd like to see some of the available col-* options removed due to lack of use.

Has someone asked for the ability to theme zinit logging? It seems unnecessary...


FYI, I have not been online for last two months for personal reasons. I should be more active in the future.

Screenshot 2023-08-15 at 00 42 26
psprint commented 10 months ago

I've removed the 11 unused entries from themes via this script:

for col in `grep -o col-[[:alnum:]]* share/themes/blue.zsh `; do
if ! \ag ${col##col-}\} zinit*.zsh &>/dev/null; then print missentry $col;
    read -q && \
        if sed -r -i -e "s/[[:space:]]+${col}[[:space:]]+\\\$'[^']*'//g" share/themes/*.zsh
         then
              print replaced
         fi
fi
done

It's output is:

missentry col-quo
yreplaced
missentry col-quos
yreplaced
missentry col-aps
yreplaced
missentry col-tab
yreplaced
missentry col-bapo
yreplaced
missentry col-nst
bmissentry col-term
yreplaced
missentry col-baps
yreplaced
missentry col-nu
nmissentry col-bar
nmissentry col-bcmd
yreplaced
missentry col-txt
yreplaced
missentry col-bspc
missentry col-uname
nmissentry col-uninst
yreplaced
missentry col-failure
yreplaced
missentry col-ndsh
missentry col-uname

I think that the theming is a good idea because:

psprint commented 10 months ago

@vladdoster: I've did what you requested and all CI checks pass (except for docs, which I cannot generate because no docker), so could you merge?

psprint commented 10 months ago

Why isn't this PR yet merged? Is it because of doubts of usability? If yes, then I tell you that once it's merged, you'll never look back on the old, unseparated (tabular data in zinit.zsh) approach… PLEASE MERGE there isn't anything to dispute about more…

psprint commented 10 months ago

@vladdoster: ping above comment

psprint commented 10 months ago

@vladdoster: Could we please stop playing in a mouse and a cat, and merge this straightforward, harmless and cleanup patch?

psprint commented 10 months ago

@vladdoster: We could easily add support for this neon theme with the pr merged:

https://www.reddit.com/r/zsh/comments/15rj8rq

psprint commented 10 months ago

@vladdoster you seem active today. Why not merge this straightforward, harmless, cleanup patch? What is the reason?