Skip to content

ohmyzsh theme based on af-magic and refined

Notifications You must be signed in to change notification settings

johnfoland/refined-magic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

refined-magic (oh-my-zsh theme)

  • refined-magic theme preview

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_info logic, repo info line, exec-time display, and prompt glyph.
  • Colors: Adopted from AF-Magic (with a couple of custom tweaks).
  • Extras: An adaptive underscore divider line above the prompt. Untracked files are counted as "dirty".

Preview (description)

  • A gray underscore bar spans the full terminal width.
  • 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.

Features

  • Adaptive divider: Full-width underscore line in gray.
  • Repo info: Clean vcs_info summary 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@host when connected via SSH.

Color map

These are ANSI 256 color indices used by the theme:

  • Gray (divider, 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.

Differences from upstream themes

  • 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, divider, and status markers.
  • Divider line: Adds a full-width underscore line above the repo info.
  • Dirty detection: Counts untracked files as “dirty” (via git status --porcelain).
  • No Python env segment: Intentionally removed after experimentation in this repo.

Installation (oh-my-zsh)

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 ~/.zshrc

Alternative: Symlink from this repo

If 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"

Customization

Git info blue

In repo_information() adjust FG[075] to a different 256-color index (e.g., FG[081], FG[082], FG[087], FG[123]).

Divider character

Replace local underscores=${(l:$COLUMNS::_:)} with a different character, e.g. - or ·.

Exec time threshold

In cmd_exec_time(), the 5 controls when the time appears.

Notes

  • 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 .

Credits

Uninstall

  • Remove the theme file and change your ZSH_THEME to a different theme:
rm -f "$ZSH_CUSTOM/themes/refined-magic.zsh-theme"
sed -i.bak 's/^ZSH_THEME=.*/ZSH_THEME="robbyrussell"/' ~/.zshrc
source ~/.zshrc

About

ohmyzsh theme based on af-magic and refined

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages