]> git.rmz.io Git - dotfiles.git/blob - zsh/lib/50-taskwarrior.zsh
zsh: use noglob on `task` as well as the `t` alias
[dotfiles.git] / zsh / lib / 50-taskwarrior.zsh
1 if (( ! $+commands[task] )); then
2 return 1
3 fi
4
5 alias task="noglob task"
6 alias t="task"
7 alias tt="task today"
8 alias tlatest="t +LATEST"
9 alias in="noglob task add +in"
10 alias inn="in rc.context=none"
11 alias tw="task context wfh"
12 alias th="task context home"
13
14 autoload -Uz task-quote-magic
15 zle -N self-insert task-quote-magic
16
17 function tparent() {
18 # TODO: check args
19 task _get $1.rparent
20 }
21
22 function tick() {
23 if (( # < 1 || # > 2)); then
24 print >&2 "Usage: $0 <filter> [duration]"
25 return 1
26 fi
27 task $1 mod wait:${2:-1h}
28 }
29
30 function task_today_list() {
31 local task_cmd=(task rc.verbose:nothing)
32 local task_count=$($task_cmd $($task_cmd _get rc.report.today.filter) count)
33
34 local task_status=""
35 task_status+="%{$fg_bold[red]%} $task_count "
36 task_status+="%{$reset_color%}"
37 echo $task_status
38 }