Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completions from file with zcompsys



On Jun 20, 10:42pm, Dominik Vogt wrote:
}
} Reading the examples I'd have guessed that 
} 
}   zstyle ':completion:*' completer _complete _match _approximate
}   zstyle ':completion:*:*:foo' completer _complete _match
} 
} Would turn off the _approximate completer for the foo command, but
} it doesn't.

Yeah, the "completer" style is looked up very early, before the command
line has even been analyzed to figure out what command word is the
active context.

However, for _approximate specifically, you can do this:

   zstyle -e ':completion:*:approximate:*' max-errors \
     '[[ $words[1] = foo ]] && reply=(0) || \
      reply=($((($#PREFIX+$#SUFFIX)/3)) numeric)'



Messages sorted by: Reverse Date, Date, Thread, Author