Skip to content

Instantly share code, notes, and snippets.

@cuongtransc
Last active August 29, 2015 14:01
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 cuongtransc/78cc859e0a8d6b35d622 to your computer and use it in GitHub Desktop.
Save cuongtransc/78cc859e0a8d6b35d622 to your computer and use it in GitHub Desktop.
function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
function prompt_char {
if [ $UID -eq 0 ]; then
echo "%{$fg_bold[red]%}#";
else
echo "$";
fi
}
local ret_status="%(?:%{$fg_bold[green]%}➜:%{$fg_bold[red]%}➜)"
PROMPT='%{$fg_bold[cyan]%}%n@%m %{$reset_color%}%{$fg[white]%}[$(collapse_pwd)]%{$reset_color%} $(git_prompt_info)
\
${ret_status} $(prompt_char) %{$reset_color%}';
RPROMPT='%{$fg_bold[blue]%}%D{[%H:%M:%S]}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment