diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/completions/_gtd-move | 15 | ||||
-rw-r--r-- | etc/function | 5 | ||||
-rw-r--r-- | etc/functions/gtd-move | 18 |
3 files changed, 36 insertions, 2 deletions
diff --git a/etc/completions/_gtd-move b/etc/completions/_gtd-move new file mode 100644 index 0000000..e9e7bc5 --- /dev/null +++ b/etc/completions/_gtd-move @@ -0,0 +1,15 @@ +#compdef gtd-move + +typeset -a arguments + +arguments=( + ':from database:_gtd_database' + ':item: ' + ':to database:_gtd_database' +) + +function _gtd_database { + _path_files -W ~/var/gtd -g '*(.)' +} + +_arguments -s $arguments diff --git a/etc/function b/etc/function index a8f4007..ecd9ea4 100644 --- a/etc/function +++ b/etc/function @@ -7,8 +7,9 @@ autoload catch throw autoload zargs # own functions -autoload check_com chpwd dirinfo extr git-hook plonkhost put reload rtab salias -autoload world-readable xexport xsource youtube-watch +autoload check_com chpwd dirinfo extr git-hook gtd-move \ + plonkhost put reload rtab salias \ + world-readable xexport xsource youtube-watch colors chpwd diff --git a/etc/functions/gtd-move b/etc/functions/gtd-move new file mode 100644 index 0000000..c9eee09 --- /dev/null +++ b/etc/functions/gtd-move @@ -0,0 +1,18 @@ +## vim:ft=zsh + +if [[ ${#*} != 3 ]] { + echo "Usage: gtd-move <from-database> <item> <to-database>" + return +} + +typeset prefix="$HOME/var/gtd" +typeset format='display=%T\n%p' +typeset from=$1 +typeset itemno=$2 +typeset to=$3 +typeset IFS=$'\n' +typeset -a item + +item=($(todo --database $prefix/$from --format $format $itemno)) +todo --database $prefix/$to --priority $item[2] --add $item[1] +todo --database $prefix/$from --remove $itemno |