Command palette: word-level search with multi-token cross-column matching#9727
Merged
kovidgoyal merged 2 commits intokovidgoyal:masterfrom Mar 23, 2026
Merged
Conversation
…hing Implement a word-level scoring engine for the command palette that replaces the previous FZF-based approach. Query tokens are matched against pre-tokenized words in each column (key, action, category) with exact, prefix, and edit-distance scoring. Multiple search terms are supported with cross-column matching — items matching more tokens rank higher. Compound query tokens containing delimiters (e.g. mouse_selection) are matched as units. Add comprehensive tests using a Go builder API instead of raw JSON blobs, covering single-token, multi-token, partial-match, ranking, mouse binding, and unmapped action scenarios. Add documentation for the command palette kitten.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Kovid,
Since using it I discovered that the current search mechanism was not ideal. So I improved it:
Implement a word-level scoring engine that replaces the previous FZF-based approach. The fzf approach was to restrictive. Instead allow multiple tokens, each matched independently and their scores combined. Tokens are separated by space.
Added documentation and tests.
Highlight matches in current selection
Now you can search for "click mouse" and it will match "mouse_click".
thanks again
--dmg