mirror of
https://github.com/jimeh/tmuxifier.git
synced 2026-02-19 09:56:39 +00:00
Initial commit
This commit is contained in:
14
completion/tmuxifier.bash
Normal file
14
completion/tmuxifier.bash
Normal file
@@ -0,0 +1,14 @@
|
||||
_tmuxifier() {
|
||||
COMPREPLY=()
|
||||
local word="${COMP_WORDS[COMP_CWORD]}"
|
||||
|
||||
if [ "$COMP_CWORD" -eq 1 ]; then
|
||||
COMPREPLY=( $(compgen -W "$(tmuxifier commands)" -- "$word") )
|
||||
else
|
||||
local command="${COMP_WORDS[1]}"
|
||||
local completions="$(tmuxifier completions "$command")"
|
||||
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _tmuxifier tmuxifier
|
||||
19
completion/tmuxifier.zsh
Normal file
19
completion/tmuxifier.zsh
Normal file
@@ -0,0 +1,19 @@
|
||||
if [[ ! -o interactive ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
compctl -K _tmuxifier tmuxifier
|
||||
|
||||
_tmuxifier() {
|
||||
local word words completions
|
||||
read -cA words
|
||||
word="${words[2]}"
|
||||
|
||||
if [ "${#words}" -eq 2 ]; then
|
||||
completions="$(tmuxifier commands)"
|
||||
else
|
||||
completions="$(tmuxifier completions "${word}")"
|
||||
fi
|
||||
|
||||
reply=("${(ps:\n:)completions}")
|
||||
}
|
||||
Reference in New Issue
Block a user