mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

how to get the most recent match ?

Open kforner opened this issue 6 years ago • 8 comments

Hi, Thanks for this nice software.

Quite often, I want to recall a command I typed a few minutes ago (e.g. "git commit ..."), but mcfly proposes some much more older matching commands. I understand that it is due to its algorithm, but I'd like to force it to output the matches ordered by "recentness". Is that possible ? Otherwise would it be possible to add a shortcut that will reorder the matches by recentness ?

Karl

kforner avatar Mar 26 '19 16:03 kforner

Hey @kforner, I'm glad you like it!

I think that's a good idea-- I've been wanting that too. I usually just hit the up arrow in the terminal to get to commands within my most recent ~10 commands, but it would be nice if there was a function key to switch McFly into recency mode. Any interest in working on this?

cantino avatar Mar 27 '19 23:03 cantino

Any interest in working on this?

I really don't have the time, and I never used rust so the time to get started is just too high.

Do you have the date of the command saved in your history ?

kforner avatar Mar 28 '19 09:03 kforner

Yes, all the time data is stored, so the work would be in making a new view in the UI.

cantino avatar Mar 28 '19 14:03 cantino

I think it's a good idea-- hopefully I, or another user, will have time to add it.

cantino avatar Mar 28 '19 14:03 cantino

instead you could switch to the regular bash search mechanism, e.g. typing again CTRL+R would switch to the bash search. Or remapping the standard bash search on another shortcut ?

kforner avatar Mar 28 '19 16:03 kforner

I think switching back to the default on-the-fly would be hard. I'm not sure how you'd configure bash to do that.

cantino avatar Apr 03 '19 05:04 cantino

I have been thinking about this as I often find the top results are things that I did many times a while ago, but are no longer relevant - for example pushing a specific git remote/branch combo.

I was wondering about a couple of options:

  • We could tune the algorithm to be favor more recent results a bit more.
  • More simply, perhaps we could just push the most recent match (or two) as the top result in the listing.

Thoughts?

grugnog avatar Jan 10 '20 20:01 grugnog

I also feel the same here. I really like the usability and the look and feel of the tool. My approach would be to disable the "smart" search by folder.

I would like you to show me the recent commands and folders that I don't work on so much I would leave the tool's default behaviour in the folders that I'm constantly working on.

mrcosta avatar May 03 '21 08:05 mrcosta