summary refs log tree commit diff
path: root/.zshrc
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2012-03-30 17:21:11 -0400
committerJune McEnroe <june@causal.agency>2012-03-30 17:21:11 -0400
commit3c50e0803ba243f011fc5303b3d6e3e163115ce8 (patch)
tree6537387421a97373db7fbb99051eefb59a35d3e8 /.zshrc
parentRemove ZSH gvim function and clean up .zshrc (diff)
downloadsrc-3c50e0803ba243f011fc5303b3d6e3e163115ce8.tar.gz
src-3c50e0803ba243f011fc5303b3d6e3e163115ce8.zip
Add task count to prompt
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc9
1 files changed, 6 insertions, 3 deletions
diff --git a/.zshrc b/.zshrc
index 59855107..af981a90 100644
--- a/.zshrc
+++ b/.zshrc
@@ -142,11 +142,14 @@ alias killlall='killall'
 alias irb='ripl'
 alias l='ls'
 
-function prompt_char {
-	echo '%(!.#.$)'
+setopt PROMPT_SUBST
+
+function prompt_task {
+  COUNT=$(task count -longterm)
+  [ "$COUNT" -gt 0 ] && echo "[%{$fg[red]%}$COUNT%{$fg[green]%}]"
 }
 
-PROMPT="%{$terminfo[bold]$fg[green]%}[%{$fg[blue]%}%30<..<%~%{$fg[green]%}]%(!.#.$)%{$terminfo[sgr0]$reset_color%} "
+PROMPT="%{$terminfo[bold]$fg[green]%}[%{$fg[blue]%}%30<..<%~%{$fg[green]%}]\$(prompt_task)%(!.#.$)%{$terminfo[sgr0]$reset_color%} "
 RPROMPT="%(?..%{$terminfo[bold]$fg[green]%}[%{$fg[red]%}%?%{$fg[green]%}]%{$terminfo[sgr0]%})"
 
 source ~/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh