A stylish Zsh theme with deliberate use of space. Single file. No dependencies. Highly customizable.
The namesake of the prompt, a line above the information with matching colors. May be disabled with HL_SEP_MODE=off
for a more compact prompt.
<user> @ <host> (<venv>): <path> | <branch> [<status>]
This line collapses to fit within the terminal width. Individually style each segment of the information line using ANSI SGR codes (which are conveniently aliased in the theme file). You can customize nearly everything about the segments and even add your own.
A segment with symbols describing the status of the current Git repository.
Symbol | Meaning |
---|---|
+ |
Staged changes |
! |
Unstaged changes |
? |
Untracked files |
↓ |
Commits behind |
↑ |
Commits ahead |
↕ |
Commits diverged |
* |
Stashed files |
✘ |
Conflicts |
(none) | Clean branch |
Download the headline.zsh-theme
file.
wget https://raw.githubusercontent.com/moarram/headline/main/headline.zsh-theme
In your ~/.zshrc
, source the headline.zsh-theme
file.
source your/path/to/headline.zsh-theme
More details in Installation
The headline.zsh-theme
file describes variables (around line 80) for customizing prompt behavior, colors, styles, symbols, etc. You can edit the theme file directly or set these variables in your ~/.zshrc
after sourcing the theme to override the defaults. There are plenty of options so play around and make it your own!
More details in Customization
For the continuous line above the prompt, use a font with ligatures such as Fira Code. Alternatively, use the "lower 1/8th block" character instead of underscores with HL_SEP[_LINE]='▁'
.
If you want symbols, use a font that has them such as FiraCode Nerd Font and include your desired symbols in HL_CONTENT_TEMPLATE
.
More details in Terminal Setup
Screenshots of theme in iTerm2. Using FiraCode Nerd Font for continuous line and fancy icons.
Status showing
+
for staged changes,!
for unstaged changes, and?
for untracked files.
Optional icons, special font required.
Path truncated to fit in available space, user and host hidden.
Options to show clock (
HL_CLOCK_MODE=on
), show exit code with meaning (HL_ERR_MODE=detail
), and hide identical information (HL_INFO_MODE=auto
).
- Headline's Git status functions are inspired by
git.zsh
in Oh-My-Zsh's core library. - Thanks to u/romkatv (author of Powerlevel10k) for the Reddit post describing how to calculate prompt string display length.