From f4d3c1599fe520ef79928d6868ff76aef3e4e486 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Sun, 10 Jun 2012 18:06:33 -0500 Subject: [PATCH] cleaning up prompt --- zsh/prompt.zsh | 46 ++++------------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index 29c02de..58cca7f 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -1,6 +1,4 @@ autoload colors && colors -# cheers, @ehrenmurdick -# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh git_branch() { echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'}) @@ -21,17 +19,17 @@ git_dirty() { fi } -git_prompt_info () { +git_prompt_info() { ref=$(/usr/bin/git symbolic-ref HEAD 2>/dev/null) || return # echo "(%{\e[0;33m%}${ref#refs/heads/}%{\e[0m%})" echo "${ref#refs/heads/}" } -unpushed () { +unpushed() { /usr/bin/git cherry -v @{upstream} 2>/dev/null } -need_push () { +need_push() { if [[ $(unpushed) == "" ]] then echo " " @@ -40,45 +38,9 @@ need_push () { fi } -rb_prompt(){ - if $(which rbenv &> /dev/null) - then - echo "%{$fg_bold[yellow]%}$(rbenv version | awk '{print $1}')%{$reset_color%}" - else - echo "" - fi -} - -# This keeps the number of todos always available the right hand side of my -# command line. I filter it to only count those tagged as "+next", so it's more -# of a motivation to clear out the list. -todo(){ - if $(which todo.sh &> /dev/null) - then - num=$(echo $(todo.sh ls +next | wc -l)) - let todos=num-2 - if [ $todos != 0 ] - then - echo "$todos" - else - echo "" - fi - else - echo "" - fi -} - directory_name(){ echo "%{$fg_bold[cyan]%}%1/%\/%{$reset_color%}" } -export PROMPT=$'$(rb_prompt) in $(directory_name) $(git_dirty)$(need_push)\n› ' +export PROMPT=$'in $(directory_name) $(git_dirty)$(need_push)\n➜ ' -set_prompt () { - export RPROMPT="%{$fg_bold[cyan]%}$(todo)%{$reset_color%}" -} - -precmd() { - title "zsh" "%m" "%55<...<%~" - set_prompt -}