Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save o3bvv/fe9c5f3e0b5a83c94b599d007a447d27 to your computer and use it in GitHub Desktop.
Save o3bvv/fe9c5f3e0b5a83c94b599d007a447d27 to your computer and use it in GitHub Desktop.
Custom theme for "oh-my-zsh"
# Put to "$ZSH_CUSTOM/themes/"
# The theme is based on 'eastwood','terminalparty', and 'lukerandall'.
# Color aliases for indices output by running 'spectrum_ls' command.
FG_CREAM=$FG[007]
FG_CYAN=$FG[006]
FG_GREEN=$FG[002]
FG_GREY=$FG[010]
FG_PURPLE=$FG[013]
FG_TERRACOTTA=$FG[009]
# Git customization
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$FG_GREEN%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG_TERRACOTTA%}● %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
# Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
local cb=$(git_current_branch)
if [ -n "$cb" ]; then
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
PROMPT='%{$FG_GREY%}%D{%d.%m %H:%M:%S}%{$reset_color%}% %{$bold_color%}%(?:%{$FG_PURPLE%} » :%{$FG_TERRACOTTA%} » )%{$reset_color%}'
RPS1='$(git_custom_status) %{$FG_CYAN%}%2~ %{$FG_GREY%}%m%{$reset_color%}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment