From fc84fb7733e3ed4dd3c5c3b7f46521212af0c2a7 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sat, 13 Sep 2008 15:43:03 +0100 Subject: [PATCH] make completion more strict and enable corrections --- .zsh/zshrc/20_compsys | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.zsh/zshrc/20_compsys b/.zsh/zshrc/20_compsys index f55e5a8..cd620b0 100644 --- a/.zsh/zshrc/20_compsys +++ b/.zsh/zshrc/20_compsys @@ -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 -- 2.39.5