geometry is a minimal, customizable zsh prompt theme.
I started chopping away at Avit until I ended up with something minimal and inspired on Pure.
What it does:
- display current git branch
- display colored time since last commit (optional)
- display state (clean/dirty) of the repo
- display arrows indicating if you need to pull, push or if you are mid-rebase
- set the terminal title to current command and directory
- display the number of git conflicts and total conflicts (optional)
- colorize the ▲ based on the current hostname (optional)
- colorize the ▲ when running under root user (optional)
- make you the coolest hacker in the whole Starbucks
Much like Pure, geometry adds a different marker
if the last command result is different from 0
. It also sets the title to
[command @] directory
. Check the title and marker here:
Just add antigen bundle frmendes/geometry
to your .zshrc
.
Move geometry.zsh
to $HOME/.oh-my-zsh/custom/themes/geometry.zsh-theme
and
set ZSH_THEME="geometry"
in your .zshrc
.
Add zplug "frmendes/geometry"
to your .zshrc
The symbol for rebasing comes from a Powerline patched font. If you want to use it, you're going to need to install one from the font repo. The one used in the screenshots is Roboto Mono. You can also try to patch it yourself.
Alternatively, change the symbol by setting the GEOMETRY_SYMBOL_GIT_REBASE
variable. See options
geometry has plenty of customization options available. Just set the variables in the
beginning of the geometry.zsh
file to whatever you like! You can also set the custom options in
your .zshrc
before loading the prompt. See my
dotfiles where I set the options for
geometry
before loading antibody.
You can optionally have the prompt display both the number of files with
conflicts as well as the total number of conflicts by setting the
PROMPT_GEOMETRY_GIT_CONFLICTS
variable to true.
This option uses grep
and ag
with the latter being a much faster alternative.
If you don't have ag
installed, this might slow your prompt down.
You can optionally hide the time since last commit by setting the
PROMPT_GEOMETRY_GIT_TIME
variable to false. You might want to
do this if the prompt is too slow on large repositories.
You can optionally have the ▲ (or whatever GEOMETRY_PROMPT_SYMBOL
you set)
change colors based on a simple hash of your hostname by setting the
PROMPT_GEOMETRY_COLORIZE_SYMBOL
variable to true.
You can have your prompt symbol change colors when running under the root user.
To activate this option, just set PROMPT_GEOMETRY_COLORIZE_ROOT
to true. Symbol and color can be customized by changing the GEOMETRY_SYMBOL_ROOT
and GEOMETRY_COLOR_ROOT
variables.
Note that this option overrides the color hashing of your prompt symbol.