Last Updated: February 25, 2016
·
1.077K
· benwoody

Disable ZSH Autocorrection

I don't like the fact that ZSH rewards my careless typing by attempting to setup autocorrect aliases. It seems like everytime I type too fast making a git commit or try to do a database edit, I always get:

zsh: correct 'gt' to git' [nyae]?

No, dammit.

And what's worse is that there are the occasional commands I DO type in correctly that it STILL tries to autocorrect.

So how can we just get rid of this "feature"?

You can add the line below to your .zshrc file in your home directory. Personally, I use Robby Russel's Oh My ZSH. I like to keep my additions and updates in a separate file at ~/.oh-my-zsh/custom/my.zsh

unsetopt correct_all

Add this line and then relaunch zsh. Voila!

1 Response
Add your response

I got annoyed by this too, but didn't want to turn the feature off altogether as it's quite useful at times. I found out you can turn it off for specific commands as well. Let's say you've got a command 'gt' which you don't want to be corrected, then add " alias gt='nocorrect gt' " to your .zshrc file.

over 1 year ago ·