zstyle ":completion:*" file-patterns "%p:globbed" "*"
zstyle ":completion:*" matcher-list "" "m:{a-z-}={A-Z_}" "r:|?=** m:{a-z-}={A-Z_}"
zstyle ":completion:*:man:*:*:*" matcher-list "" "m:{a-zA-Z}={A-Za-z} l:|=* r:|=*"
-zstyle ":completion:*" completer _mycomp_mbox:mbox _mycomp _mycomp_man:man _parameters _ignored
-
-_mycomp () {
+zstyle ":completion:*" completer \
+ _mycomp_mbox \
+ _mycomp \
+ _mycomp_man:man \
+ _mycomp_info \
+ _parameters \
+ _ignored
+
+_mycomp() {
[[ $CURRENT -eq 1 ]] && curcontext="${curcontext%:*:*}:-command-:" \
_command_names && return
[[ $IPREFIX =~ ~.* ]] && _tilde && return
# }}}
}
-_mycomp_man () {
- [[ ${words[1]} == man ]] && curcontext=:man:${curcontext#:*:} \
- _dispatch "" man man "" -default- && _value && return
- [[ ${words[1]} == info ]] && curcontext=:info:${curcontext#:*:} \
- _dispatch "" info info "" -default- && return
+_mycomp_man() {
+ [[ ${words[1]} == man ]] && _dispatch man man man "" -default- && _value && return
+}
+
+_mycomp_info() {
+ [[ ${words[1]} == info ]] && _dispatch info info info "" -default- && return
}
local mboxes=()
for m ($MAILDIR/*(/on)) mboxes=($mboxes $m:t)
-_mycomp_mbox () {
- [[ ${words[1]} == mbox ]] && curcontext=:mbox:${curcontext#:*:} \
- _values mailboxes $mboxes && return
+_mycomp_mbox() {
+ [[ ${words[1]} == mbox ]] && _values mboxes $mboxes && return
}
autoload -U compinit ; compinit -d /tmp/.zcompdump