There’s probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things “just work”: not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don’t need any weird magic like in Bash if you want to use an alias with the same completion
Hmm, it didn’t “just work” for me. I had to set it up recently:
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
That line needs to go in .zshrc. Maybe it’s enabled by default with oh-my-zsh?
I’m sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh