Skip to main content
deleted 197 characters in body
Source Link
Marlon Richert
  • 4.3k
  • 11
  • 38

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?=r:X|Y=Z looks for all non-overlapping substrings that match pattern XY and makes it so the part matched by X also matches any one characteranything matched by pattern Z when checking for matching completions.
  • r:|? matches any substring that endsone character.
  • If (rX) in or ?Y equals (any one character)*, it matches any number of consecutive characters.
  • r:|?=* says, in your input, from left to right, find a substring that ends in If ?Z (any one character), insert aequals * (wildcard, whichit matches any number of consecutive characters) into the position indicated except anything matched by the |Y and try to find completion matches with that. 
  • If that fails, find the next such input substringZ equals **, until you either find one or more completionit matches or you run outany number of substringsconsecutive characters.
  • In r:|?=** says, in your input, find every substring that ends in ? (any one character), insert a wildcard (*X) into every position indicated by equals the | and try to find completion matches with thatempty string.
  • Finally, byBy default, Zsh already adds a wildcard to the end of your input, thus completing the circle for full fuzzy matching.

You can find the documentation over here: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?= matches any one character.
  • r:|? matches any substring that ends (r) in ? (any one character).
  • r:|?=* says, in your input, from left to right, find a substring that ends in ? (any one character), insert a * (wildcard, which matches any number of characters) into the position indicated by the | and try to find completion matches with that. If that fails, find the next such input substring, until you either find one or more completion matches or you run out of substrings.
  • r:|?=** says, in your input, find every substring that ends in ? (any one character), insert a wildcard (*) into every position indicated by the | and try to find completion matches with that.
  • Finally, by default, Zsh already adds a wildcard to the end of your input, thus completing the circle for full fuzzy matching.

You can find the documentation over here: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

  • r:X|Y=Z looks for all non-overlapping substrings that match pattern XY and makes it so the part matched by X also matches anything matched by pattern Z when checking for matching completions.
  • ? matches any one character.
  • If X or Y equals *, it matches any number of consecutive characters.
  • If Z equals *, it matches any number of consecutive characters except anything matched by Y. 
  • If Z equals **, it matches any number of consecutive characters.
  • In r:|?=**, X equals the empty string.
  • By default, Zsh already adds a wildcard to the end of your input, thus completing the circle for full fuzzy matching.

You can find the documentation over here: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control

Add link
Source Link
Marlon Richert
  • 4.3k
  • 11
  • 38

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?= matches any one character.
  • r:|? matches any substring that ends (r) in ? (any one character).
  • r:|?=* says, in your input, from left to right, find a substring that ends in ? (any one character), insert a * (wildcard, which matches any number of characters) into the position indicated by the | and try to find completion matches with that. If that fails, find the next such input substring, until you either find one or more completion matches or you run out of substrings.
  • r:|?=** says, in your input, find every substring that ends in ? (any one character), insert a wildcard (*) into every position indicated by the | and try to find completion matches with that.
  • Finally, by default, Zsh already adds a wildcard to the end of your input, thus completing the circle for full fuzzy matching.

You can find the documentation over here: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?= matches any one character.
  • r:|? matches any substring that ends (r) in ? (any one character).
  • r:|?=* says, in your input, from left to right, find a substring that ends in ? (any one character), insert a * (wildcard, which matches any number of characters) into the position indicated by the | and try to find completion matches with that. If that fails, find the next such input substring, until you either find one or more completion matches or you run out of substrings.
  • r:|?=** says, in your input, find every substring that ends in ? (any one character), insert a wildcard (*) into every position indicated by the | and try to find completion matches with that.
  • Finally, by default, Zsh already adds a wildcard to the end of your input, thus completing the circle for full fuzzy matching.

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?= matches any one character.
  • r:|? matches any substring that ends (r) in ? (any one character).
  • r:|?=* says, in your input, from left to right, find a substring that ends in ? (any one character), insert a * (wildcard, which matches any number of characters) into the position indicated by the | and try to find completion matches with that. If that fails, find the next such input substring, until you either find one or more completion matches or you run out of substrings.
  • r:|?=** says, in your input, find every substring that ends in ? (any one character), insert a wildcard (*) into every position indicated by the | and try to find completion matches with that.
  • Finally, by default, Zsh already adds a wildcard to the end of your input, thus completing the circle for full fuzzy matching.

You can find the documentation over here: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html#Completion-Matching-Control

Make the explanation less ambiguous/more precise.
Source Link
Marlon Richert
  • 4.3k
  • 11
  • 38

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?= matches any one character you’ve typed.
  • r:|? anchors it to the right, meaning that the algorithm will look formatches any part of a completionsubstring that ends on the right with this character.
  • (=*r matches any number of characters) in the possible completions? (any one character).
  • r:|?=* matches anysays, in your input, from left to right, find a substring that ends in ? (any one character you’ve typed and allows), insert a * (wildcard, which matches any number of additional characters before it in completions) into the position indicated by the | and try to find completion matches with that. If that fails, find the next such input substring, until you either find one or more completion matches or you run out of substrings.
  • r:|?=** means the samesays, but repeated any number of timesin your input, find every substring that ends in ? (any one character), insert a wildcard (*) into every position indicated by the | and try to find completion matches with that.
  • Finally, by default, Zsh already matches completions with any number of charactersadds a wildcard to the rightend of what you’ve typedyour input, thus completing the circle for full fuzzy matching.

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?= matches any one character you’ve typed.
  • r:|? anchors it to the right, meaning that the algorithm will look for any part of a completion that ends on the right with this character.
  • =* matches any number of characters in the possible completions.
  • r:|?=* matches any one character you’ve typed and allows any number of additional characters before it in completions.
  • r:|?=** means the same, but repeated any number of times.
  • Finally, by default, Zsh already matches completions with any number of characters to the right of what you’ve typed, thus completing the circle for full fuzzy matching.

Get rid of that _gd function and just add the following to your .zshrc file:

autoload -Uz compinit compinit zstyle ':completion:*' matcher-list 'r:|?=**' 

This tells the completion code to allow any number of additional between and around what you’ve types. With this, Zsh can now fuzzy complete anything.

In more detail:

  • ?= matches any one character.
  • r:|? matches any substring that ends (r) in ? (any one character).
  • r:|?=* says, in your input, from left to right, find a substring that ends in ? (any one character), insert a * (wildcard, which matches any number of characters) into the position indicated by the | and try to find completion matches with that. If that fails, find the next such input substring, until you either find one or more completion matches or you run out of substrings.
  • r:|?=** says, in your input, find every substring that ends in ? (any one character), insert a wildcard (*) into every position indicated by the | and try to find completion matches with that.
  • Finally, by default, Zsh already adds a wildcard to the end of your input, thus completing the circle for full fuzzy matching.
Additional explanation
Source Link
Marlon Richert
  • 4.3k
  • 11
  • 38
Loading
Additional explanation
Source Link
Marlon Richert
  • 4.3k
  • 11
  • 38
Loading
Source Link
Marlon Richert
  • 4.3k
  • 11
  • 38
Loading