Skip to content

Instantly share code, notes, and snippets.

@maddiesch
Last active March 18, 2021 17:42
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 maddiesch/cba3504ca18d96f58a419712d3481de0 to your computer and use it in GitHub Desktop.
Save maddiesch/cba3504ca18d96f58a419712d3481de0 to your computer and use it in GitHub Desktop.
function __git_prompt () {
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return
fi
echo -n "%{$fg[cyan]%}($(git_current_branch))"
echo -n "%{$fg[green]%}[$(git rev-parse HEAD 2> /dev/null | head -c 6)]"
echo -n "%{$fg[cyan]%} $(parse_git_dirty)$(git_remote_status)"
echo -n "%{$reset_color%}"
}
function __dev_env () {
if [[ "$DEV_ENV" == "local" ]]; then
echo -n "%{$FG[134]%}$DEV_ENV %{$reset_color%}"
else
echo -n "%{$FG[201]%}@$DEV_ENV %{$reset_color%}"
fi
}
ZSH_THEME_GIT_PROMPT_DIRTY="✗"
ZSH_THEME_GIT_PROMPT_CLEAN="✔"
ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE=""
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=" 🌩"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE=" 🌥"
PROMPT='%{$fg[yellow]%}[%c]$(__git_prompt)'
PROMPT="$(__dev_env)$PROMPT%{$fg_bold[white]%} -> %{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment