Skip to content

Instantly share code, notes, and snippets.

@jplattel
Last active January 18, 2020 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jplattel/34f14bb95854c84a547d7049142270b0 to your computer and use it in GitHub Desktop.
Save jplattel/34f14bb95854c84a547d7049142270b0 to your computer and use it in GitHub Desktop.
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