A minimal, fast prompt that blends the layout of the Refined theme with the vibrant color palette of AF-Magic.
- Structure: Based on Refined's
vcs_infologic, repo info line, exec-time display, and prompt glyph. - Colors: Adopted from AF-Magic (with a couple of custom tweaks).
- Extras: A blank buffer line above the prompt that spaces out consecutive commands. Untracked files are counted as "dirty".
- A blank line separates each command from the one before it.
- The next line shows repo/path info in cyan and blue, with a dirty mark when applicable.
- Command exec time (if > 5s) appears in orange.
- The prompt char is magenta, turning red on non-zero exit status.
- Buffer line: A blank line above each prompt, so consecutive commands are visually separated.
- Repo info: Clean
vcs_infosummary with branch and state. - Dirty indicator:
*appended when the repo is dirty, including untracked files. - Exec time: Only shows when the last command took >5 seconds.
- SSH context: Right prompt shows
user@hostwhen connected via SSH.
These are ANSI 256 color indices used by the theme:
- Gray (RPROMPT user@host):
FG[237] - Cyan (repo/path):
FG[032] - Light blue (VCS system and branch):
FG[075] - Orange (dirty mark and exec time):
FG[214] - Magenta (prompt carat):
FG[105] - Light pink (available for customization):
FG[218]
Note: Colors are provided by oh-my-zsh's color helpers ($FG, $fg, %{$reset_color%}) which are available to themes by default.
- Structure from Refined: Uses
vcs_info,preexec/precmd, and the❯prompt glyph; shows exec time when >5s. - Colors from AF-Magic: Applies AF-Magic-inspired colors to path, VCS, and status markers.
- Buffer line: Adds a blank line above the repo info to space out consecutive commands.
- Dirty detection: Counts untracked files as “dirty” (via
git status --porcelain). - No Python env segment: Intentionally removed after experimentation in this repo.
I. Copy the theme file into your oh-my-zsh custom themes directory:
mkdir -p "$ZSH_CUSTOM/themes"
cp refined-magic.zsh-theme "$ZSH_CUSTOM/themes/"II. Set the theme in ~/.zshrc:
ZSH_THEME="refined-magic"III. Apply it:
source ~/.zshrcIf you keep this repository elsewhere, symlink instead of copy:
mkdir -p "$ZSH_CUSTOM/themes"
ln -s /absolute/path/to/refined-magic/refined-magic.zsh-theme "$ZSH_CUSTOM/themes/refined-magic.zsh-theme"In repo_information() adjust FG[075] to a different 256-color index (e.g., FG[081], FG[082], FG[087], FG[123]).
In precmd(), the print "" adds the blank line above the prompt. Remove it for a
compact prompt, or repeat it for more spacing.
In cmd_exec_time(), the 5 controls when the time appears.
- The theme uses
vcs_info(autoloaded by zsh) and standard Git commands for dirty checks. - Works best with a terminal that supports 256 colors and a font with the prompt glyph
❯.
The README image is generated with VHS, so it stays in sync with the theme. From the repo root:
brew install vhs
vhs .vhs/demo.tape
ffmpeg -y -sseof -0.5 -i .vhs/demo.gif -update 1 -frames:v 1 refined-magic-screenshot.png.vhs/.zshrc is a minimal oh-my-zsh config that sources the theme from the working
tree, so the screenshot reflects local changes rather than whatever is installed.
- AF-Magic theme by Andy Fleming — oh-my-zsh wiki AF-Magic
- Refined theme (oh-my-zsh) — oh-my-zsh wiki Refined
- The refined theme itself credits Sindre Sorhus (Pure) and Julien Nicoulaud as inspirations.
- Remove the theme file and change your
ZSH_THEMEto a different theme:
rm -f "$ZSH_CUSTOM/themes/refined-magic.zsh-theme"
sed -i.bak 's/^ZSH_THEME=.*/ZSH_THEME="robbyrussell"/' ~/.zshrc
source ~/.zshrc