jaoypq
Last Updated: February 25, 2016
·
18.36K
· natansh

Disabling Autocorrect in Zsh

The autocorrect feature in Zsh seems like a boon but more often than not, it annoys rather than helps.

Often one gets a warning akin to the following....
zsh: correct 'rspec' to 'spec' [nyae]? %
which can be really annoying.

To switch off this autocorrect for just one particular command, add the following line to .zshrc
alias vim='nocorrect <CommandName> '
nocorrect is a precommand modifier that prevents a spell check on any following words and must precede any other precommand modifier.

However, if you want to disable it completely, add this to .zshrc
unsetopt correct_all

7 Responses
Add your response

4681

Thanks! Very helpful.

over 1 year ago ·
7152

For newer versions of Oh My ZSH, I believe you have to use the following:

unsetopt correct

Sup @priestap. What a coincidence. ;-)

over 1 year ago ·
7154

Neither of which seem to work for me....

over 1 year ago ·
8408

There's a flag in .zshrc
DISABLE_CORRECTION="true"

works for me

over 1 year ago ·
8463

DISABLE_CORRECTION="true" works for me, very handy!

over 1 year ago ·
11054

setopt nocorrectall; works fine

over 1 year ago ·
14764

I use:

$ zsh --version
zsh 5.0.2 (x86_64-pc-linux-gnu)

Just in case someone else get bitten by this: set the option /after/ calling source oh-my-zsh.sh, otherwise the setting can get over-ridden by the oh-my-zsh scripts.

From my zshrc:

source $ZSH/oh-my-zsh.sh
# Options: These have to go after oh-my-zsh or they can get over-ridden
setopt CSH_NULL_GLOB
unsetopt correct_all
over 1 year ago ·
Filed Under