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
Written by Natansh Verma
Related protips
7 Responses
Thanks! Very helpful.
For newer versions of Oh My ZSH, I believe you have to use the following:
unsetopt correct
Sup @priestap. What a coincidence. ;-)
Neither of which seem to work for me....
There's a flag in .zshrc
DISABLE_CORRECTION="true"
works for me
DISABLE_CORRECTION="true" works for me, very handy!
setopt nocorrectall; works fine
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