Skip to content

Instantly share code, notes, and snippets.

@zph
Created May 28, 2012 04:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zph/2817304 to your computer and use it in GitHub Desktop.
Save zph/2817304 to your computer and use it in GitHub Desktop.
todo_count(){
if $(which todo.sh &> /dev/null)
then
num=$(echo $(todo.sh ls | grep "^[0-9]" | wc -l))
let todos=num
if [ $todos != 0 ]
then
echo "$todos"
else
echo ""
fi
else
echo ""
fi
}
function zle-line-init zle-keymap-select {
RPS1="${${KEYMAP/vicmd/>>> ○[$(todo_count)]}/(main|viins)/± <<<[$(todo_count)]}"
RPS2=$RPS1
zle reset-prompt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment