Skip to content

Instantly share code, notes, and snippets.

@eiro
Created October 4, 2011 13:05
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 eiro/1261597 to your computer and use it in GitHub Desktop.
Save eiro/1261597 to your computer and use it in GitHub Desktop.
my zsh prompt
precmd () {
local gitwhere=$( stfu2 git symbolic-ref HEAD)
[[ -n $gitwhere ]] || gitwhere=$( stfu2 git describe)
[[ -n $gitwhere ]] && {
local modif=`git s|wc -l`
[[ $modif = 0 ]] && modif="" || modif="($modif files modified)"
gitwhere="[${gitwhere##*/}$modif]"
}
export PS1="[%T] %n@%M%b:%d $gitwhere"$'\n'"> "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment