diff --git a/zsh/completion.zsh b/zsh/completion.zsh index cb6539b..c1f9be7 100644 --- a/zsh/completion.zsh +++ b/zsh/completion.zsh @@ -50,17 +50,21 @@ zstyle ':completion:::::' completer \ _force_rehash _expand _complete _prefix _ignored _approximate #TODO: keep _prefix or not? +# ignore case when trying to match typed characters +zstyle ':completion:*:(^approximate):*' matcher-list 'm:{a-z}={A-Z}' + +# allow one mistake per three characters +zstyle -e ':completion:*:approximate:*' max-errors \ + 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )' + # ===== completion appearance # use ls colors for completion -# Fallback to built in ls colors -#zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" # Make the list prompt friendly -zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s' - +zstyle ':completion:*:default' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s' # Make the selection prompt friendly when there are a lot of choices -zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' +zstyle ':completion:*:default' select-prompt '%SScrolling active: current selection at %p%s' # Add simple colors to kill zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' @@ -70,9 +74,6 @@ zstyle ':completion:*' menu select=1 _complete _ignored _approximate # insert all expansions for expand completer # zstyle ':completion:*:expand:*' tag-order all-expansions -# match uppercase from lowercase -zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' - # offer indexes before parameters in subscripts zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters