Skip to content

Instantly share code, notes, and snippets.

@kramerc
Created February 9, 2015 00:25
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 kramerc/a3cf3d0adfbbb30e3d26 to your computer and use it in GitHub Desktop.
Save kramerc/a3cf3d0adfbbb30e3d26 to your computer and use it in GitHub Desktop.
# vim:ft=zsh ts=2 sw=2 sts=2
#
# kramerc's theme
# Based on philips's theme.
prompt_context() {
local context user_fg
if [ $UID -eq 0 ]; then
# Root user
user_fg="%F{red}"
else
# Normal user
user_fg="%F{green}"
fi
if [[ `whoami` != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
# Print the username and hostname
context="%{$user_fg%}%B%n%b%{$reset_color%}@%m"
fi
if [[ $context != "" ]]; then
# Print the context along with the separator
echo -n "$context:"
fi
}
PROMPT='$(prompt_context)%{$fg[blue]%}%B%~%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
# Timestamp on the right
#RPROMPT='[%*]'
# Git theming
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[red]%}%B"
ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment