fzy icon indicating copy to clipboard operation
fzy copied to clipboard

Add new option 'all' to output all matches

Open lamarpavel opened this issue 7 years ago • 7 comments

This commit adds the option '--all' / '-a', which will cause fzy to ignore the selection and output all matching lines on return.

I needed this feature so I could call fzy from vim and fill a location-list with the output. I just found fzy today and was pleasantly surprised by how clean the code base is and how easy it was to add new functionality, so I just wrote this small patch. There might be better ways to solve this, possibly without changing fzy. Feel free to reject this PR and point me in a different direction in that case.

lamarpavel avatar Mar 12 '17 13:03 lamarpavel

I've been using fzy for a day, it's really great! This feature is the only extra thing I really want from it.

insidewhy avatar Apr 10 '17 12:04 insidewhy

@jhawthorn would you be interested in this patch if it was cleaned up and submitted with a test? I'd really like to help get this feature delivered.

insidewhy avatar Apr 10 '17 13:04 insidewhy

In https://github.com/jhawthorn/fzy/pull/40 I added an action_emit_all which can be bound via the keybinding system added in that PR. This could be an alternative to the -a flag, or both could be supported with the -a flag swapping emit and emit all bindings.

insidewhy avatar Apr 16 '17 11:04 insidewhy

@lamarpavel I'm going to maintain a fork that accepts contributions from the community at https://github.com/ohjames/fzu until the maintainer here has time to engage with us. It already has the ability to select "all matches" and configurable key bindings.

insidewhy avatar May 13 '17 14:05 insidewhy

@ohjames Thank you for notifying me, and thanks to the AUR package I'm already using it.

lamarpavel avatar May 13 '17 17:05 lamarpavel

Cool if you need a flag to make "select all" the default I'll happily accept it :) For me selecting with a binding is best.

insidewhy avatar May 13 '17 17:05 insidewhy

That's all right, but maybe you should enable issues in your repo in case someone has comments to things not relevant for fzy (eg. you replaced one fzy -> fzu too many in the readme).

lamarpavel avatar May 13 '17 17:05 lamarpavel