Skip to content

Instantly share code, notes, and snippets.

@nyaray
Created May 10, 2012 07:12
Show Gist options
  • Save nyaray/2651622 to your computer and use it in GitHub Desktop.
Save nyaray/2651622 to your computer and use it in GitHub Desktop.
WiP zshtheme
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="%F{yellow}✗%f "
if [ $UID -eq 0 ]; then
NCOLOR="red";
PCHAR="#";
else
NCOLOR="green";
PCHAR="$";
fi
if [ -n "$ZSH_THEME_ELEGANCE_PCHAR" ]; then
PCHAR=$ZSH_THEME_ELEGANCE_PCHAR;
fi
# Customized git status, oh-my-zsh currently does not allow render dirty status
# before branch
git_custom_status() {
local cb=$(current_branch)
if [ -n "$cb" ]; then
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(parse_git_dirty)%F{blue}$(current_branch)%f$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
PROMPT='%{$fg[$NCOLOR]%}%m %{$fg[blue]%}%~%{$reset_color%} $PCHAR %{$reset_color%}'
RPROMPT='%{$fg[blue]%}%p$f $(git_custom_status)%f'
# See http://geoff.greer.fm/lscolors/
export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx"
export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment