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

feature request: regex search #278

Open
YAMLcase opened this issue Aug 17, 2022 · 7 comments
Open

feature request: regex search #278

YAMLcase opened this issue Aug 17, 2022 · 7 comments

Comments

@YAMLcase
Copy link

how doable would it be to add regex search to mcfly?

@cantino
Copy link
Owner

cantino commented Aug 17, 2022

The search happens in SQLlite, so we could potentially use the REGEXP operator. How would you enter regexp mode?

@YAMLcase
Copy link
Author

YAMLcase commented Aug 17, 2022

In vim cmd mode, hit / is what seems natural to me. But the better way would probably be an environment variable setting and then you just use regex in the normal search line. I think people will either use it all the time or never depending on their comfort level with regex.

@cantino
Copy link
Owner

cantino commented Aug 18, 2022

You can currently do % as a wildcard BTW. Does that help?

@YAMLcase
Copy link
Author

You can currently do % as a wildcard BTW. Does that help?

Oh yea, I found that last night and it helps a ton. Still, regex will shine when trying to find that vaguely remembered command from a year ago in the midst of 100's of similar iterations.

@cantino
Copy link
Owner

cantino commented Aug 26, 2022

I'm open to contributions around this. It will need to be implemented in SQLite since that's where the search happens inside of McFly.

@sou-chon
Copy link

I can have a look at this. But REGEXP is not implemented in sqlite so will rely on external library / a custom function.

@espdev
Copy link

espdev commented Dec 26, 2023

The search happens in SQLlite, so we could potentially use the REGEXP operator. How would you enter regexp mode?

Maybe use something like fzf search syntax instead of modes?

You can also use the config options. For example, most of the time I search for commands in history by first characters. I would like to use an option similar to "prefix-exact-match" in fzf but without ^ as a basic.

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

4 participants