Created
January 29, 2009 23:36
-
-
Save noah/54842 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# zsh crap | |
# | |
# include git info in the prompt | |
parse_git_dirty() { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
# see: http://www.cims.nyu.edu/cgi-systems/info2html?(zsh)Prompt%2520Expansion | |
export PS1='%B%(?..[%?] )%{$fg_bold[yellow]%}%(1j.%U[%j]%u .)%{$reset_color%}%{$fg_bold[red]%}$(parse_git_branch)%{$reset_color%} | |
%% ' | |
# Suffix aliases | |
alias -s tex=vim | |
alias -s rb=vim | |
alias -s pl=vim | |
alias -s conf=vim | |
alias -s php=vim | |
alias -s txt=vim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment