From 98eef4184a7298a6f27388028dbfd4a5ff4b5ff6 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Thu, 22 Mar 2018 11:41:21 -0500 Subject: [PATCH 1/2] [completion] Improve fuzzy completion matching This will present the menu in case of ambiguous matches, and also expand by any separator, not just `[._-]`. Based on the configuration suggested at https://superuser.com/a/815317/637926 Closes #212 --- modules/completion/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index ef5a68e..1a54bd1 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -56,7 +56,7 @@ zstyle ':completion:*:warnings' format '%F{red}-- no matches found --%f' zstyle ':completion:*' format '%F{yellow}-- %d --%f' zstyle ':completion:*' group-name '' zstyle ':completion:*' verbose yes -zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' +zstyle ':completion:*' matcher-list 'r:|?=** m:{a-zA-Z}={A-Za-z}' # directories zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} From e1a2a38a0f69ef33f089226d9fb0ebc709a10859 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Fri, 23 Mar 2018 08:36:16 -0500 Subject: [PATCH 2/2] [completion] Prefer left-matching before fuzzy all still being case insensitive. Having just fuzzy matching returns too many matches in the average case. --- modules/completion/init.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 1a54bd1..37079dc 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -56,7 +56,8 @@ zstyle ':completion:*:warnings' format '%F{red}-- no matches found --%f' zstyle ':completion:*' format '%F{yellow}-- %d --%f' zstyle ':completion:*' group-name '' zstyle ':completion:*' verbose yes -zstyle ':completion:*' matcher-list 'r:|?=** m:{a-zA-Z}={A-Za-z}' +local case_insensitive='m:{a-zA-Z}={A-Za-z}' +zstyle ':completion:*' matcher-list ${case_insensitive} "${case_insensitive} r:|?=**" # directories zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}