Skip to content

Commit

Permalink
Improve completion matching
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed Oct 28, 2021
1 parent d81f760 commit 86cd5e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/.autocomplete.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _autocomplete.config.completer() {
if [[ CURRENT -eq 1 && -z $PREFIX$SUFFIX && $compstate[context] == command ]]; then
reply=( _complete )
else
reply=( _expand _complete _correct _complete:-fuzzy _ignored )
reply=( _expand _complete _correct _complete:-loose _complete:-fuzzy _ignored )
fi
}
builtin zstyle ':completion:list-expand:*' completer \
Expand Down Expand Up @@ -70,9 +70,10 @@ builtin zstyle ':completion:list-expand:*:git-*:(|*-)argument-*:*' tag-order '*'

# Order of matchers matters: m should come before r, which should come before l.
# Otherwise, the results are not as expected.
builtin zstyle ':completion:*' matcher-list \
'm:{[:lower:]-}={[:upper:]_} r:|[.]=** r:?|[-_]=* l:?|=[-_\\ ]'
builtin zstyle ':completion:*-fuzzy:*' matcher-list \
builtin zstyle ':completion:*' matcher-list ''
builtin zstyle ':completion:*-loose:*' matcher-list \
'm:{[:lower:]-}={[:upper:]_} r:|[.]=** l:?|=[-_\\ ] r:?||[-_]=*'
builtin zstyle ':completion:*-fuzzy:*' matcher-list \
'm:{[:lower:]-}={[:upper:]_} r:|?=**'

builtin zstyle ':completion:*:options' matcher 'b:-=+'
Expand Down

0 comments on commit 86cd5e1

Please sign in to comment.