Skip to content

Instantly share code, notes, and snippets.

@ryopeko
Created June 23, 2010 01:52
Show Gist options
  • Save ryopeko/449371 to your computer and use it in GitHub Desktop.
Save ryopeko/449371 to your computer and use it in GitHub Desktop.
export LANG=ja_JP.UTF-8
alias ls='ls --color=auto'
alias e='emacs'
autoload -U colors; colors
function rprompt-git-current-branch {
local name st color
if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then
return
fi
name=$(basename "`git symbolic-ref HEAD 2> /dev/null`")
if [[ -z $name ]]; then
return
fi
st=`git status 2> /dev/null`
if [[ -n `echo "$st" | grep "^nothing to"` ]]; then
color=${fg[green]}
elif [[ -n `echo "$st" | grep "^nothing added"` ]]; then
color=${fg[yellow]}
elif [[ -n `echo "$st" | grep "^# Untracked"` ]]; then
color=${fg_bold[red]}
else
color=${fg[red]}
fi
echo "%{$color%}$name%{$reset_color%}%B:%b"
}
setopt prompt_subst
PROMPT="%n%% "
RPROMPT='%B[%b`rprompt-git-current-branch`%B${HOST}:%~]%b'
SPROMPT="correct: %R -> %r ? "
setopt auto_pushd
setopt pushd_ignore_dups
setopt auto_menu
setopt list_packed
HISTFILE=$HOME/.zsh-history
HISTSIZE=50000
SAVEHIST=50000
setopt extended_history
setopt share_history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment