Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
# DESCRIPTION: Put your git branch and a unicode skull and crossbones in your prompt. # EXAMPLE: http://www.scrnshots.com/users/topfunky/screenshots/89842 # AUTHOR: Geoffrey Grosenbach http://peepcode.com # From git distribution, slightly modified to work with zsh source ~/bin/dotfiles/git-completion.zsh # Get the name of the branch we are on git_prompt_info() { branch_prompt=$(__git_ps1) if [ -n "$branch_prompt" ]; then status_icon=$(git_status) echo $branch_prompt $status_icon fi } # Show character if changes are pending git_status() { if current_git_status=$(git status | grep 'added to commit' 2> /dev/null); then echo "☠" fi } autoload -U colors colors setopt prompt_subst PROMPT=' %~%{$fg_bold[black]%}$(git_prompt_info) → %{$reset_color%}'
This paste will be private.
From the Design Piracy series on my blog: