18

I have zsh and oh-my-zsh with default values and can't figure out how to turn off autocorrection for specific commands, that I often use, such as: sudo mc or sudo gem update. The thing is that I have .mc directory and .gem directory and zsh proposes autocorrections (zsh: correct 'mc' to '.mc' [nyae]).

Generally I would like to config zsh so that sudo [smth] is not considered a separate command (which it is not) for autocorrection. What would be a fix for that?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175

1 Answers1

21

Add this to your ~/.zshrc

alias sudo='nocorrect sudo'
George M
  • 13,589
  • 4
  • 43
  • 53