Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tzing/clover.zsh-theme
đ a configurable theme for zsh
https://github.com/tzing/clover.zsh-theme
zsh-theme
Last synced: about 2 months ago
JSON representation
đ a configurable theme for zsh
- Host: GitHub
- URL: https://github.com/tzing/clover.zsh-theme
- Owner: tzing
- License: mit
- Created: 2018-04-17T03:05:49.000Z (about 6 years ago)
- Default Branch: trunk
- Last Pushed: 2023-09-19T10:20:38.000Z (9 months ago)
- Last Synced: 2024-01-24T18:03:39.970Z (4 months ago)
- Topics: zsh-theme
- Language: Shell
- Homepage:
- Size: 318 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License
Lists
- awesome-zsh-plugins - clover - Inspired by [zeta](https://github.com/skylerlee/zeta-zsh-theme) and [pure](https://github.com/sindresorhus/pure). (Themes / ZSH on Windows)
- fucking-awesome-zsh-plugins - clover - Inspired by <b><code> 223â</code></b> <b><code> 69đ´</code></b> [zeta](https://github.com/skylerlee/zeta-zsh-theme)) and <b><code> 12878â</code></b> <b><code> 970đ´</code></b> [pure](https://github.com/sindresorhus/pure)). (Themes / ZSH on Windows)
- awesome-zsh-plugins - clover - Inspired by [zeta](https://github.com/skylerlee/zeta-zsh-theme) and [pure](https://github.com/sindresorhus/pure). (Themes / Zinit (nÊe zplugin))
- awesome-zsh-plugins - clover - Inspired by [zeta](https://github.com/skylerlee/zeta-zsh-theme) and [pure](https://github.com/sindresorhus/pure). (Themes / ZSH on Windows)
README
# Clover
đ a configurable theme for [zsh], inspired by [zeta-zsh-theme] and [pure].
![screenshot](./screenshot.png)
[zsh]: https://en.wikipedia.org/wiki/Z_shell
[zeta-zsh-theme]: https://github.com/skylerlee/zeta-zsh-theme
[pure]: https://github.com/sindresorhus/pure- Highlights environment changes
Username and host changes the style for special environments: root, remote, container
- Async VCS status
Background process, don't blocks your workflow
- Execution time
Show human readable execution time for long run command
- Python
Virtualenv prompt is included
- Show the error
Prompt indicator changes whether the last run success (đ/đĨ)
- Configurable
Read the configuration section below
## Installation
#### [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh)
clone this repo into `$ZSH_CUSTOM`:
```bash
cd ${ZSH_CUSTOM:-"~/.oh-my-zsh/custom"}/themes
git clone [email protected]:tzing/clover.zsh-theme.git clover
```then change the theme:
```zsh
ZSH_THEME="clover/clover"
```#### [zinit](https://github.com/zdharma-continuum/zinit)
```zsh
zinit light tzing/clover.zsh-theme
```#### Manual
clone this repo to somewhere you like:
```sh
git clone [email protected]:tzing/clover.zsh-theme.git
```and source the main script in your `.zshrc`
```zsh
source /clover.zsh-theme
```## Configurations
This theme reads the configurations from [`zstyle`]. All context name must be prefixed with `:prompt:clover:`. Styles are always configurable, and for some components you could also customized the symbols.
Here's a disgram that shows context names:
```txt
â---------------------------------------------------------------------------- user
| â----------------------------------------------------------------------- host
| | â------------------------------------------------------------- path
| | | â----------------------------------------- vcs:branch
| | | | â---------------------------------- vcs:status (read details below)
| | | | | â------------------- execution-time
| | | | | | â-------------- current-time
# user@hostname: ~/clover.zsh-theme 10s (12:00:00 +0800)
(.venv) đ
| â----------------------------------------------------------------------- prompt
â------------------------------------------------------------------------------ venv
```[`zstyle`]: https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#index-zstyle
**Styles**
Run zstyle command with the key `style`. And the value could be the [visual effect] expresssion in zsh prompt expansion.
[visual effect]: https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html#Visual-effects
An example of setting the path to bold cyan:
```bash
zstyle :prompt:clover:path style '%B%F{cyan}'
```**Symbols**
Use key `symbol` for customization. For example, setting VCS staged info to literally the text ``:
```bash
zstyle :prompt:clover:vcs:status:staged style ''
```| context name | usage | default style | default symbol |
| ---------------------- | --------------------------------------------- | ----------------------------- | ----------------- |
| `current-time` | Current time | blue | *(not supported)* |
| `execution-time` | Last execution time | 242 | *(not supported)* |
| `host:container` | Host name when it is inside a container | bold white text in magenta bg | *(not supported)* |
| `host:default` | Host name | bold cyan | *(not supported)* |
| `host:remote` | Host name when it is remote session | bold white text in blue bg | *(not supported)* |
| `path` | Current path | bold yellow | *(not supported)* |
| `prompt:default` | Prompt color | green | đ |
| `prompt:fail` | Prompt color when last run failed | red | đĨ |
| `user:default` | User name | bold green | *(not supported)* |
| `user:root` | User name when current user is `root` | bold green | *(not supported)* |
| `vcs:action` | Current action in VCS | red | *(not supported)* |
| `vcs:branch` | Current branch name | bold blue | *(not supported)* |
| `vcs:status:ahead` | [Git only] Current branch is ahead of remote | cyan | ⥠|
| `vcs:status:behind` | [Git only] Current branch is behind of remote | magenta | âŖ |
| `vcs:status:clean` | [Git only] Work tree is clean | green | â |
| `vcs:status:diverge` | [Git only] Diverged changes found | red | â |
| `vcs:status:staged` | Found staged changes in current repo | green | ⥠|
| `vcs:status:unstaged` | Found unstaged changes in current repo | magenta | âą |
| `vcs:status:untracked` | [Git only] Found untracked file | 242 | ? |
| `virtualenv` | Python [virtualenv] prompt prefix | 242 | *(not supported)* |[virtualenv]: https://virtualenv.pypa.io/en/latest/
> **Note**
>
> VCS information (`:prompt:clover:vcs:*`) are evaluated in background process, which is forked in first [precmd] run.
> Runtime zstyle settings will not take effect. But you could still change the style in `.zshrc`.
>
> [precmd]: https://zsh.sourceforge.io/Doc/Release/Functions.html#index-precmd### Others
There are some other settings could be changed through `zstyle` too:
| context name | key | usage | default |
| ---------------- | -------------------- | ---------------------------------------------------------------- | ------------- |
| `current-time` | `format` | Format for current time. See [strftime(3)] for more details. | `%H:%M:%S %z` |
| `execution-time` | `min-display-second` | Only show execution time when last run is longer than this time. | 5 |[strftime(3)]: https://man7.org/linux/man-pages/man3/strftime.3.html