Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching with exact match #135

Closed
zhou13 opened this issue Nov 28, 2023 · 4 comments
Closed

Searching with exact match #135

zhou13 opened this issue Nov 28, 2023 · 4 comments

Comments

@zhou13
Copy link

zhou13 commented Nov 28, 2023

Sometimes, it is convenient to have an option to search with exact match. Let's say I want to search for for i in. Right now, I got
Screenshot 2023-11-28 at 11 06 18 AM

which are not very relevant. It would be nice if we could have a way to toggle the exact match vs fuzzy search or to enter a regular expression manually.

@ddworken
Copy link
Owner

Currently, this is already possible by typing in a query like for\ i\ in that escapes the spaces. But I think you are right that we're missing any documentation for this, and that we could probably make this clearer. WDYT of adding support for just quoting anything that you want to be an exact match? That way it would be possible to have a query like "for i in" cwd:/tmp/foo/.

@zhou13
Copy link
Author

zhou13 commented Dec 12, 2023

Thank you! Quoting is probably the most intuitive way to do this.

ddworken added a commit that referenced this issue Dec 13, 2023
* Add support for quoted searchs for exact matches, for #135

* Add support for quoting search queries

* Fix spliteEscaped so that it works with escaping dashes and colons in search queries
@mustafa0x
Copy link

I wonder does fzf's fuzzy matching score the same?

I copied the below two lines, then ran pbpaste | fzf, and it seemed to score correctly, but I can't say that my test is conclusive.

history config-set timestampt-format
for i in

@ddworken
Copy link
Owner

Thanks for that comment @mustafa0x! I think that is conceptually a separate feature request, so I opened #158 to track that improvement. Marking this one as closed, but please let me know if you have any other thoughts on exact match searches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants