Jovial
Jovial - A lovely zsh theme with responsive-design, it's pretty fast, keep simple but useful
Install / Use
/learn @zthxxx/JovialREADME
Overview
<p align="center"> <img src="./docs/jovial.png" alt="jovial" width="720"> </p>Jovial is designed for users who want a straightforward ZSH experience without unnecessary complexity. Whether you're new to ZSH or an experienced user, Jovial offers an intuitive interface with helpful features that enhance your command-line workflow.
<br />TOC
<p align="center"> <span><strong> · </strong></span> <a href="#features--preview"><strong>Features</strong></a> <span> / </span> <a href="#plugins-integration"><strong>Plugins</strong></a> <span> / </span> <a href="#install"><strong>Install</strong></a> <span> / </span> <a href="#customization"><strong>Customization</strong></a> <span> / </span> <a href="#benchmark"><strong>Benchmark</strong></a> <span> / </span> <a href="#migration"><strong>Migration</strong></a> <span><strong> · </strong></span> </p> <br />Features & Preview
Complete Feature Set
Jovial comes packed with useful features. Here's how it looks with all features enabled:
<p align="center"> <img src="./docs/jovial-full-prompts.png" alt="jovial-full-prompts" width="900"> </p>The description of each part:
<p align="center"> <img src="./docs/jovial-description.png" alt="jovial-description" style="width: 100%; max-width: 1000px"> </p>Responsive Design
Each part of the prompt is "responsive" to the terminal window's width, so you can safely use it in a narrow terminal.
<!-- ./docs/jovial-responsive-desigin.mp4 --> <div><video controls muted autoplay loop src="https://user-images.githubusercontent.com/15135943/148246834-08ecbbfc-6d0e-4c25-96b5-3638b32a4a28.mp4"></video></div>Git Actions State
In addition to the basic git state (branch / tag / hash, dirty or clean),
there are also some prompts to hint that you are in merge / rebase / cherry-pick now with conflict or not.
Note that all git states will be updated asynchronously, so this theme is pretty fast even in a huge git repo.
<p align="center"> <img src="./docs/jovial-git-actions.png" alt="jovial-git-actions" width="860"> </p>Development Environment Detection
It will detect and show your development programming language and version in the current working directory,
support Python, Conda, NodeJs, Golang, PHP out-of-box, such as:
<p align="center"> <img src="./docs/jovial-develop-env-detect.png" alt="jovial-develop-env-detect" width="740"> </p>venv environment for Python:
Support detecting the venv, virtualenv, conda environment activated by default.
For conda (miniconda), you need set conda config --set changeps1 false to avoid conda auto change the theme's prompt.
Show Execution Elapsed Time
<p align="center"> <img src="./docs/jovial-exec-elapsed.png" alt="jovial-exec-elapsed" width="600"> </p>Plugins Integration
These integrated plugins below will be auto-setup by the install script. You can see the
install.zsh-pluginsfunction in installer.sh
- jovial: Jovial plugin defines some utility functions and aliases. You can see them in jovial.plugin.zsh
- git: Short aliases for commonly used commands
- zoxide: It remembers which directories you use most frequently, so you can "jump" to them in just a few keystrokes.
- bgnotify: Background notifications for long-running commands
- zsh-history-enquirer: Widget for history searching, enhances
Ctrl+R - zsh-autosuggestions: Shell auto-completion
- zsh-syntax-highlighting: User input syntax highlighting
Install
Just run the simple one-line install command:
curl -sSL https://github.com/zthxxx/jovial/raw/master/installer.sh | sudo -E bash -s ${USER:=`whoami`}
Note: The install script is designed to be "Idempotent", so you can safely execute it multiple times.
Tips: You may want to use some http proxy. Just export proxy variables before running the install command,
like:
export all_proxy=http://127.0.0.1:1086(it's equal to
export http_proxy=http://127.0.0.1:1086 http_proxys=http://127.0.0.1:1086)
Here is what the install command and script do:
-
Explain the command:
sudo: Ensures the script runs with access to install packages and change the default login shell-E: Passes through environment variables while using sudo, to receive variables likehttp_proxy-s $USER: Passes the parameters to the script, which is the real target user for installation
-
The script performs these steps:
- If
zshoroh-my-zshis not found, it will install them - Changes the default login shell to
zsh - Downloads the jovial theme/plugin files in the oh-my-zsh custom folder
- Installs integrated plugins via the local package manager
- Automatically rewrites the
ZSH_THEMEandpluginsvariables in the user's.zshrc
- If
Install with Zinit
Zinit is a fast plugin manager for zsh with simple declarative configuration.
Install Jovial and its plugins with just a single line in your .zshrc:
zinit light-mode depth=1 multisrc='*.plugin.zsh' for zthxxx/jovial
See the full out-of-the-box Zinit config here:
https://github.com/zthxxx/jovial/blob/master/examples/zinit.zshrc
Use this example .zshrc as a starter:
curl -SL https://github.com/zthxxx/jovial/raw/master/examples/zinit.zshrc -o ~/.zshrc
Install with Antigen
Antigen is a theme/plugin manager for zsh that uses simple declarative configuration.
With Antigen, installing Jovial without sudo permission is easy.
Just download Antigen and copy the example below into your ~/.zshrc,
reload zsh, and Antigen will automatically download everything only during initialization.
Download Antigen:
mkdir -p ~/.antigen && curl -SL https://github.com/zsh-users/antigen/raw/develop/bin/antigen.zsh -o ~/.antigen/antigen.zsh
Example for ~/.zshrc with Antigen:
You can manually copy this below into your
~/.zshrcfile, or use the command to download and append:
curl -SL https://github.com/zthxxx/jovial/raw/master/examples/antigen.zshrc >> ~/.zshrc
# ~/.zshrc
# [Antigen](https://github.com/zsh-users/antigen),
# a theme/plugin manager for zsh that uses simple declarative configuration.
# Load Antigen
source ~/.antigen/antigen.zsh
# Basic recommended for Antigen
antigen use oh-my-zsh
antigen bundle git
antigen bundle zoxide
antigen bundle colored-man-pages
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
# Load the Jovial theme and plugins
antigen theme zthxxx/jovial
antigen bundle zthxxx/jovial
antigen bundle zthxxx/zsh-history-enquirer
# Any other plugins need to be set before `antigen apply`
# After all, tell Antigen that you're done, then Antigen will start
antigen apply
Then reload zsh to load Antigen with the Jovial theme:
exec zsh -il
Note that you also need to manually install other plugin bin files like:
sudo apt install -y zoxide terminal-notifier source-highlight
Install with Fig
Fig adds apps, shortcuts, and autocomplete to your existing terminal.
Install the jovial theme in just one click.
<a href="https://fig.io/plugins/other/jovial_zthxxx" target="_blank"><img src="https://fig.io/badges/install-with-fig.svg" /></a>
Manually Install Without oh-my-zsh
First, you need to download the jovial.zsh-theme file manually. For example, using curl:
curl -sSL "https://github.com/zthxxx/jovial/raw/master/jovial.zsh-theme" -o ~/.config/jovial.zsh-theme
Then, add these zsh settings in your ~/.zshrc and load the theme file:
# ~/.zshrc
source ~/.config/jovial.zsh-theme
Finally, don't forget to change the default login shell to zsh. You can use the chsh command:
sudo chsh -s `command -v zsh` $USER
Upgrade
Using Antigen
With Antigen, it's simple to update the jovial theme by using antigen update:
antigen update zthxxx/jovial
Note that this ONLY updates the jovial theme, without any ot
