diff options
| author | Vito Graffagnino <vito@graffagnino.xyz> | 2020-09-08 13:31:02 +0100 |
|---|---|---|
| committer | Vito Graffagnino <vito@graffagnino.xyz> | 2020-09-08 13:31:02 +0100 |
| commit | 8cc927e930d5b6aafe3e9862a61e81705479a1b4 (patch) | |
| tree | d9b75e65c2440ef0943c5598ccdddaf50a06ca44 /.zsh.d | |
Initial commit. .z* files added
Diffstat (limited to '.zsh.d')
| -rw-r--r-- | .zsh.d/_buku | 53 | ||||
| -rw-r--r-- | .zsh.d/_cht | 21 |
2 files changed, 74 insertions, 0 deletions
diff --git a/.zsh.d/_buku b/.zsh.d/_buku new file mode 100644 index 0000000..66303b6 --- /dev/null +++ b/.zsh.d/_buku @@ -0,0 +1,53 @@ +#compdef buku +# +# Completion definition for buku. +# +# Author: +# Arun Prakash Jana <engineerarun@gmail.com> +# + +setopt localoptions noshwordsplit noksharrays +local -a args +args=( + '(-a --add)'{-a,--add}'[add bookmark]:URL tags' + '(--ai)--ai[auto-import bookmarks]' + '(-c --comment)'{-c,--comment}'[comment on bookmark]' + '(--cached)--cached[visit Wayback Machine cached version]:index/url' + '(--colors)--colors[set output colors in 5-letter string]:color string' + '(-d --delete)'{-d,--delete}'[delete bookmark]' + '(--deep)--deep[search matching substrings]' + '(-e --export)'{-e,--export}'[export bookmarks]:html/md/db output file' + '(--expand)--expand[expand a tny.im shortened URL]:index/shorturl' + '(-f --format)'{-f,--format}'[limit fields in print and JSON output]:value' + '(-h --help)'{-h,--help}'[show help]' + '(-i --import)'{-i,--import}'[import bookmarks]:html/md/db input file' + '(--immutable)--immutable[disable title update from web]:value' + '(-j --json)'{-j,--json}'[show JSON output for print and search]:file' + '(-k --unlock)'{-k,--unlock}'[decrypt database]' + '(-l --lock)'{-l,--lock}'[encrypt database]' + '(-n --count)'{-n,--count}'[results per page]:value' + '(--nc)--nc[disable color output]' + '(--np)--np[noninteractive mode]' + '(-o --open)'{-o,--open}'[open bookmarks in browser]' + '(--oa)--oa[browse all search results immediately]' + '(-p --print)'{-p,--print}'[show bookmark details]' + '(-r --sreg)'{-r,--sreg}'[match a regular exression]:regex' + '(--replace)--replace[replace a tag]:tag to replace' + '(-s --sany)'{-s,--sany}'[match any keyword]:keyword(s)' + '(-s --sall)'{-s,--sall}'[match all keywords]:keyword(s)' + '(--shorten)--shorten[shorten a URL using tny.im]:index/url' + '(--suggest)--suggest[show a list of similar tags]' + '(-t --stag)'{-t,--stag}'[search by tag or show tags]' + '(--tacit)--tacit[reduce verbosity]' + '(--tag)--tag[set tags, use + to append, - to remove]' + '(--threads)--threads[max connections for full refresh]:value' + '(--title)--title[set custom title]' + '(-u --update)'{-u,--update}'[update bookmark]' + '(--url)--url[set url]:url' + '(-V)-V[check latest upstream release]' + '(-v --version)'{-v,--version}'[show program version]' + '(-w --write)'{-w,--write}'[open editor]' + '(-x --exclude)'{-x,--exclude}'[exclude keywords]:keyword(s)' + '(-z --debug)'{-z,--debug}'[enable debugging mode]' +) +_arguments -S -s $args diff --git a/.zsh.d/_cht b/.zsh.d/_cht new file mode 100644 index 0000000..e1a4230 --- /dev/null +++ b/.zsh.d/_cht @@ -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 |
