]> git.donarmstrong.com Git - zsh.git/commitdiff
make completion more strict and enable corrections
authormartin f. krafft <madduck@madduck.net>
Sat, 13 Sep 2008 14:43:03 +0000 (15:43 +0100)
committermartin f. krafft <madduck@madduck.net>
Sat, 13 Sep 2008 14:43:03 +0000 (15:43 +0100)
.zsh/zshrc/20_compsys

index f55e5a833f371d3ae898d93e33282f4f25aff69c..cd620b08125e5504206303b38de334641fb9c39e 100644 (file)
@@ -20,6 +20,9 @@ setopt rec_exact
 # move cursor to end of word being completed
 setopt always_to_end
 
+# correct the command if mistyped
+setopt correct
+
 # correct all arguments, not just the command
 #setopt correctall
 
@@ -38,7 +41,7 @@ zstyle ':completion:*' use-cache on
 zstyle ':completion:*' cache-path $ZVARDIR/compcache
 
 #zstyle ':completion:*' completer _list _expand _complete _ignored _match _correct _approximate _prefix
-zstyle ':completion:*' completer _complete _ignored _match _approximate
+zstyle ':completion:*' completer _complete _ignored _match _correct _approximate
 
 # allow cursor-key navigation through completion set
 zstyle ':completion:*:*:*:*' menu select
@@ -50,7 +53,10 @@ zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
 zstyle ':completion:*:(all-|)files' ignored-patterns \
   '*.bk' '*.bak' '*.old' '*~' '.*.sw?' '*.o' '*.pyc'
 
-zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) numeric )'
+zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) not-numeric )'
+zstyle -e ':completion:*:correct:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/2)) numeric )'
+#zstyle ':completion:*:correct:::' max-errors 1 not-numeric
+#zstyle ':completion:*:approximate:::' max-errors 2 numeric
 
 #zstyle ':completion:*' list-suffixes true
 #zstyle ':completion:*' match-original both