From 7cf218b4e516de46e86a92bb5c0fd1cf47233d3c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 20 Nov 2015 04:54:55 -0500 Subject: [PATCH] Add zsh/completion/* --- zprofile | 5 +++++ zsh/completion/_lsarchive | 13 +++++++++++++ zsh/completion/_tmuxinator | 30 ++++++++++++++++++++++++++++++ zsh/completion/_unarchive | 13 +++++++++++++ 4 files changed, 61 insertions(+) create mode 100755 zsh/completion/_lsarchive create mode 100755 zsh/completion/_tmuxinator create mode 100755 zsh/completion/_unarchive diff --git a/zprofile b/zprofile index de51d551..89252eab 100644 --- a/zprofile +++ b/zprofile @@ -45,3 +45,8 @@ path=( /usr/{bin,sbin} /{bin,sbin} ) + +fpath=( + ~/.zsh/completion + $fpath +) diff --git a/zsh/completion/_lsarchive b/zsh/completion/_lsarchive new file mode 100755 index 00000000..00f83e05 --- /dev/null +++ b/zsh/completion/_lsarchive @@ -0,0 +1,13 @@ +#compdef lsarchive +#autoload + +# +# Completes lsarchive. +# +# Authors: +# Sorin Ionescu +# + +_arguments \ + '(-v --verbose)'{-v,--remove}'[verbose archive listing]' \ + "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z)(-.)'" && return 0 diff --git a/zsh/completion/_tmuxinator b/zsh/completion/_tmuxinator new file mode 100755 index 00000000..4c76c94a --- /dev/null +++ b/zsh/completion/_tmuxinator @@ -0,0 +1,30 @@ +#compdef tmuxinator mux + +_tmuxinator() { + local commands projects + commands=(${(f)"$(tmuxinator commands zsh)"}) + projects=(${(f)"$(tmuxinator completions start)"}) + + if (( CURRENT == 2 )); then + _describe -t commands "tmuxinator subcommands" commands + _describe -t projects "tmuxinator projects" projects + elif (( CURRENT == 3)); then + case $words[2] in + copy|debug|delete|open|start) + _arguments '*:projects:($projects)' + ;; + esac + fi + + return +} + +_tmuxinator + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et diff --git a/zsh/completion/_unarchive b/zsh/completion/_unarchive new file mode 100755 index 00000000..aceb27b6 --- /dev/null +++ b/zsh/completion/_unarchive @@ -0,0 +1,13 @@ +#compdef unarchive +#autoload + +# +# Completes unarchive. +# +# Authors: +# Sorin Ionescu +# + +_arguments \ + '(-r --remove)'{-r,--remove}'[remove archive]' \ + "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0