From 66897bdbdc849aa4cacc7741776feb9f09a80f0a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 19 Jun 2015 16:04:03 +0200 Subject: [PATCH] Zsh: Add approximate completion --- zsh/completion.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zsh/completion.zsh b/zsh/completion.zsh index e7087a4f..c8ab6e3f 100644 --- a/zsh/completion.zsh +++ b/zsh/completion.zsh @@ -13,14 +13,15 @@ setopt AUTO_LIST # Automatically list choices on ambiguous completion. setopt AUTO_PARAM_SLASH # If completed parameter is a directory, add a trailing slash. unsetopt MENU_COMPLETE # Do not autoselect the first completion entry. unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor. +unsetopt CASE_GLOB # Use caching to make completion for commands such as dpkg and apt usable. zstyle ':completion::complete:*' use-cache on -zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache" +zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zgen/.zcompcache" # Case-insensitive (all), partial-word, and then substring completion. -zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' -unsetopt CASE_GLOB +zstyle ':completion:*' matcher-list 'm:{a-zA-Z\-}={A-Za-z\_}' #'r:|[._-]=* r:|=*' 'l:|=* r:|=*' +zstyle ':completion:*' matcher-list 'r:[[:ascii:]]||[[:ascii:]]=** r:|=* m:{a-z\-}={A-Z\_}' # Group matches and describe. zstyle ':completion:*:*:*:*:*' menu select