Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Alternative matching algorithms (substring, subsequence, etc.) for completions #568
Currently fish only supports prefix matching for completions. Consider these use cases:
zsh allows you to type
A more realistic example for the above use cases is package names - say you want to complete
Although I found zsh helpful in case 2., there is still a case it doesn't cover - when components are joined without separators. Matching the string user typed as a subsequence can solve this problem. In the case of separator-delimited components, it can be almost as accurate as zsh's method, except that
Implemented as 908b075
The algorithms we support are (in order of preference):
This works for tab completing files and executables, though not yet options.
One little thing I've noticed is that if I try to complete a long option argument when fish has no completions for that command, the double hyphens expand to
Perhaps the fuzzy matching could exclude hyphens.