Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do you disable zsh autocorrect entirely?

I am aware of the 'nocorrect' option which only applies to certain commands. But I want it off entirely so that when I type 'lear' instead of 'clear', it won't prompt for a correction.

I should note that 'unsetopt correctall' doesn't seem to do anything for me

collin@mandalay ~
  % unsetopt correctall

collin@mandalay ~
  % lear
zsh: correct 'lear' to 'clear' [nyae]? n
zsh: command not found: lear
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Ahhhh!!... I see that I was supposed to use 'unsetopt correct' instead of correct_all

collin@mandalay ~
  % unsetopt correct

collin@mandalay ~
  % lear
zsh: command not found: lear
share|improve this answer
add comment

In your .zshrc

 #disable auto correct
 unsetopt correct_all

From the manpage of zsh (zshoptions):

   CORRECT (-0)
          Try to correct the spelling of commands.  Note that, when the HASH_LIST_ALL option is not set or when some directories in the  path  are  not
          readable, this may falsely report spelling errors the first time some commands are used.

   CORRECT_ALL (-O)
          Try to correct the spelling of all arguments in a line.

So the correct option will correct ONLY the commands not the arguments on the line.

The corect_all option will correct commands AND all the arguments on the line.

share|improve this answer
    
This is incorrect. correct_all will disable autocorrect for options only, not for commands themselves. See here for an example: yountlabs.com/automation/disable-autocorrect-in-zsh –  Collin Peters Dec 7 '12 at 18:30
    
I improved my answer (forgot to login while editing it). –  Atropo Dec 8 '12 at 9:07
    
That isn't how it works for me. I am using zsh 4.3.17. See my initial post. 'unsetopt correctall' (correct_all and correctall are equivalent) then typing 'lear' instead of 'clear' results in the auto-correct prompt. Seems the name 'correct_**all**'is misleading. Based on the description it says "Try to correct the spelling of all arguments in a line' –  Collin Peters Dec 10 '12 at 4:09
    
@Collin, load order matters. It worked for me when I moved it to bottom, after oh-my-zsh –  oma Aug 26 '13 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.