Enabled the Zsh completion system

I’ll admit it: I’m a bit slow when it comes to the shell. I use it a lot, but never feel like I’m using it as well as I could. But today, I figured out how to turn on Z Shell completion system. And it is very, very good.

This guide helped me, leading me to add the following to my .zshrc file:


autoload -U compinit
compinit

Once I’d done that, I could begin completing various commands and parameters. Within a few moments, using the tutorial above, I’d already completed:

  • command names
  • file and directory paths
  • changing a directory with cd, listing only directories
  • listing each directory that would be extracted from a tar archive
  • ssh destination, including user and host
  • changing to a directory three-levels deep with cd, using only the first letter of each of the three paths (i.e. “/u/l/b” for “/usr/local/bin”).

This is cool.