Various small additions

This commit is contained in:
Alexander Gehrke (crater2150) 2016-07-22 16:01:35 +02:00
parent fe3c0fb5d5
commit 05f6bf7007
11 changed files with 208 additions and 5 deletions

3
compdef/_conf Normal file
View file

@ -0,0 +1,3 @@
#compdef conf
_arguments "1:Commands:(${(k)conf_locations})"

View file

@ -0,0 +1,33 @@
#compdef tagsistant-helper tag tcd
tagdir=${TAGSISTENT_ROOT:-$HOME/tagged}/store
_file_or_tag() {
_alternative \
"files:file:_files" \
"tags:tag:_files -W $tagdir"
}
_tag() {
typeset -A opt_args
local context state line
_arguments \
"*:argument:_file_or_tag" \
"-n[set target name]:target name:" \
"--name[set target name]:target name:" \
"-p[preview]"
}
_tcd() {
_files -W $tagdir
}
_tagsistant-helper() {
case $service in
tag) _tag;;
tcd) _tcd;;
papertag) _papertag;;
*) _message "Err";;
esac
}

8
compdef/_xd Normal file
View file

@ -0,0 +1,8 @@
#compdef xd
function _xd {
typeset -a targets
targets=("${(@f)$(xd -l)}")
_describe target targets
}