Making macOS Terminal use case-insensitive autocomplete
Jan 16, 2025 ·
In this blog post, let’s see how to make the macOS Terminal use case-insensitive autocomplete for file and folders.
Although I moved from Windows to Mac almost 20 years ago, I every so often find myself accepting certain everyday frictions out of habit, when the solution is always one quick search away.
Todays friction was how I’ve always been annoyed about not being able to type cd pro<tab>
and autocomplete it to the Projects
folder.
And sure enough, the solution was once more just a quick search away. A discussion thread led me to this gist which contains two lines that you should add to ~/.zshrc
:
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
autoload -Uz compinit && compinit
Just add it to ~/.zshrc
, save and relaunch Terminal, and you’ll have case-insensitive autocomplete!
Discussions & More
If you found this interesting, please share your thoughts on Bluesky, Mastodon, and X. Also make sure to follow to be notified when new content is published.