]> arthur.barton.de Git - ax-zsh.git/blob - default_plugins/correction/correction.zshrc
correction: Don't check for always-available commands
[ax-zsh.git] / default_plugins / correction / correction.zshrc
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # correction.zshrc: Setup correction
3
4 # Always-available commands, for example shell bultin. No need to check for
5 # existence, always define "nocorrect alias".
6 for cmd (
7         alias
8         command
9         echo
10         print
11         printf
12         type
13         which
14 ); do
15         alias $cmd="nocorrect $cmd"
16 done
17
18 # Optional commands, check for existence first before creating the alias!
19 for cmd (
20         apt
21         aptitude
22         brew
23         ebuild
24         gist
25         man
26         mkdir
27         mv
28         mysql
29         pkg_add
30         sudo
31 ); do
32         [[ -n $commands[$cmd] ]] \
33                 && alias $cmd="nocorrect $cmd"
34 done
35
36 setopt correct_all
37
38 SPROMPT="$ZSH_NAME: Correct \"$fg[yellow]%R$reset_color\" to \"$fg[green]%r$reset_color\" [$fg_bold[white]nyae$reset_color]? "
39
40 unset cmd