The official documentation for writing zsh completion functions is
difficult to understand, and doesn’t give many examples. At the time
of writing this document I was able to find a few other tutorials on
the web, however those tutorials only explain a small portion of the
capabilities of the completion system. This document aims to cover
areas not explained elsewhere, with examples, so that you can learn
how to write more advanced completion functions. I do not go into
all the details, but will give enough information and examples to
get you up and running. If you need more details you can look it up
for yourself in the official
documentation.