gitconfig: add br alias to branch; prompt: remove cabal sandbox
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
[alias]
|
||||
br = branch
|
||||
ca = commit -a
|
||||
cam = commit -am
|
||||
changes = diff --name-status -r
|
||||
|
18
zshrc
18
zshrc
@@ -96,10 +96,10 @@ function rprompt-git-current-branch {
|
||||
if [[ -z $name ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
gitdir=`git rev-parse --git-dir 2> /dev/null`
|
||||
action=`VCS_INFO_git_getaction "$gitdir"` && action="($action)"
|
||||
|
||||
|
||||
st=`git status 2> /dev/null`
|
||||
if [[ -n `echo "$st" | grep "ahead of"` ]]; then
|
||||
color=%F{white}
|
||||
@@ -112,24 +112,12 @@ function rprompt-git-current-branch {
|
||||
else
|
||||
color=%B%F{blue}
|
||||
fi
|
||||
|
||||
|
||||
echo "on %{$fg[white]%}$color$name$action%f%b %{$reset_color%}"
|
||||
}
|
||||
|
||||
function cabal_sandbox_info() {
|
||||
cabal_files=(*.cabal(N))
|
||||
if [ $#cabal_files -gt 0 ]; then
|
||||
if [ -f cabal.sandbox.config ]; then
|
||||
echo "%{$fg[white]%} is %{$fg[green]%}sandboxed%{$reset_color%}"
|
||||
else
|
||||
echo "%{$fg[white]%} is %{$fg[red]%}not sandboxed%{$reset_color%}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
RPROMPT='`rprompt-git-current-branch`'
|
||||
RPROMPT+="%{$fg[white]%}in %{$fg[yellow]%}%~%{$reset_color%}"
|
||||
RPROMPT+='`cabal_sandbox_info`'
|
||||
|
||||
extract(){
|
||||
if [ -f $1 ] ; then
|
||||
|
Reference in New Issue
Block a user