shell/zsh: add basic integration with fzf

Closes #29
This commit is contained in:
Dmitriy Pleshevskiy 2022-08-19 16:39:33 +03:00
parent bd4a581f3e
commit f7c3d2c040
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
1 changed files with 32 additions and 0 deletions

32
shell/zsh Normal file
View File

@ -0,0 +1,32 @@
function __tas_task_idx() {
echo "$@" | sed 's/^\([0-9]\+\)\..\+$/\1/'
}
function __tas_show() {
tas show $(__tas_task_idx "$@")
}
function __tas_start() {
tas start $(__tas_task_idx "$@")
}
function __tas_list() {
tas list | fzf --info=inline --height=50% --no-sort --keep-right --layout=reverse
}
function taz() {
case $1 in
"" | "show" | "sh")
__tas_show $(__tas_list)
;;
"list" | "ls")
__tas_list
;;
"start" | "st")
__tas_start $(__tas_list)
esac
}