This commit is contained in:
mr0xb 2026-05-15 12:58:08 -04:00
commit 807b7a4504
No known key found for this signature in database
GPG key ID: D61C4E28AAE1BC5C
18 changed files with 567 additions and 0 deletions

21
.zshrc.d/_cht Normal file
View file

@ -0,0 +1,21 @@
#compdef cht.sh
__CHTSH_LANGS=($(curl -s cheat.sh/:list))
_arguments -C \
'--help[show this help message and exit]: :->noargs' \
'--shell[enter shell repl]: :->noargs' \
'1:Cheat Sheet:->lang' \
'*::: :->noargs' && return 0
if [[ CURRENT -ge 1 ]]; then
case $state in
noargs)
_message "nothing to complete";;
lang)
compadd -X "Cheat Sheets" ${__CHTSH_LANGS[@]};;
*)
_message "Unknown state, error in autocomplete";;
esac
return
fi