TAB
all the way.
initialize the completion system
compinit -d ${XDG_CACHE_HOME:-$HOME}/.zcompdump
using a shell function generate completions
compdef function_to_use commands to complete
# when used as the first line of an autoloaded function found during compinit
#compdef ...
# reuse completions created for command2 for command1
compdef command1=command2
# ex:
alias tf=terraform
compdef tf=terraform
use bash completion in zsh
call after compinit
bashcompinit
how to complete commands
complete -o option -[CF] command
# commonly used to not add extra space
-o nospace
complete -C command_output_used_as_completion command
complete -F function_output_used_as_completion command