dots/scripts/fzf-tea
2024-09-13 09:12:51 -03:00

18 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
# ╭──────────────────────────────────────────────────────────╮
# │ Interactivie Issue management of tea │
# ╰──────────────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────
tea_cache="$(mktemp --directory)"
# TODO: Add more keybindings to interact with issues
tea i -o simple |
fzf \
--preview "[[ -e $tea_cache/{1}.md ]] && bat -l md $tea_cache/{1}.md || tea issue --comments {1} | tee $tea_cache/{1}.md" \
--bind "ctrl-r:execute-silent(rm -f $tea_cache/{1})+refresh-preview" \
--bind "ctrl-o:execute-silent(tea open {1})"
rm -rf "$tea_cache"