jaoypq
Last Updated: February 25, 2016
·
14.88K
· natansh
33c5b27d9e26a76f70afb5e5cceb0b14

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

Say Thanks
Respond

7 Responses
Add your response

4681
6b0148d9eb1aa92d24a3bf4bab62dbb1

Thanks! Very helpful.

over 1 year ago ·
7152
Profile image 3 gray small

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
Profile image 3 gray small

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

over 1 year ago ·
8408
123

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
1995c74eb5a3d11ea68b9a89f6f3dcbd

setopt nocorrectall; works fine

over 1 year ago ·
14764
7341105ceb315ea03e8aaf55f9f1a352

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