Skip to content

Instantly share code, notes, and snippets.

@cuongtransc
Created April 8, 2015 07:37
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/1a39f9bb1aaa8c27a9e7 to your computer and use it in GitHub Desktop.
Save cuongtransc/1a39f9bb1aaa8c27a9e7 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%}
\
${ret_status} $(prompt_char) %{$reset_color%}';
RPROMPT='%{$fg_bold[blue]%}%D{[%H:%M:%S]}%{$reset_color%}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment