I have a program, let's call it myprog
which takes a few options (-o
, --option
...) with or without argument.
Is there a way to configure zsh
so when I use the <TAB>
key it lists the options ? It is the case when I type for example ls -<TAB>
.
Here is the beginning of the file .zshrc
(I found it on the web, without understanding it...) :
# Completion
autoload -U compinit
compinit
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
#compinstall
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin \
/usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh_cache
zmodload zsh/complist
setopt extendedglob
zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
If this is possible (I'm sure it is !), is there a way to "distribute" this auto-completion, for example to all the people that will use myprog
on their computer