mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

feature request: regex search

Open YAMLcase opened this issue 3 years ago • 7 comments

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

YAMLcase avatar Aug 17 '22 23:08 YAMLcase

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

cantino avatar Aug 17 '22 23:08 cantino

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.

YAMLcase avatar Aug 17 '22 23:08 YAMLcase

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

cantino avatar Aug 18 '22 15:08 cantino

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.

YAMLcase avatar Aug 18 '22 15:08 YAMLcase

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.

cantino avatar Aug 26 '22 02:08 cantino

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

sou-chon avatar Nov 29 '22 22:11 sou-chon

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.

espdev avatar Dec 26 '23 16:12 espdev