Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Personal zsh theme
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '± >' && return
echo '>'
}
PROMPT='%{$fg[blue]%}%n%{$reset_color%} @ %{$fg[yellow]%}%m%{$reset_color%} = %{$fg_bold[red]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info)
$(prompt_char) '
RPROMPT='[%D{%H:%M:%S}]'
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[046]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[083]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.