]> arthur.barton.de Git - ax-zsh.git/blobdiff - default_plugins/correction/correction.zshrc
correction: Don't check for always-available commands
[ax-zsh.git] / default_plugins / correction / correction.zshrc
index 3f222499277a259783a3dbadd0fb04654b9d13dd..355120c73825d02ff1456922cf7234063b48e746 100644 (file)
@@ -1,6 +1,21 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # correction.zshrc: Setup correction
 
+# Always-available commands, for example shell bultin. No need to check for
+# existence, always define "nocorrect alias".
+for cmd (
+       alias
+       command
+       echo
+       print
+       printf
+       type
+       which
+); do
+       alias $cmd="nocorrect $cmd"
+done
+
+# Optional commands, check for existence first before creating the alias!
 for cmd (
        apt
        aptitude
@@ -21,3 +36,5 @@ done
 setopt correct_all
 
 SPROMPT="$ZSH_NAME: Correct \"$fg[yellow]%R$reset_color\" to \"$fg[green]%r$reset_color\" [$fg_bold[white]nyae$reset_color]? "
+
+unset cmd