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] Allow filter with no limits, like fzf --multi. #25

Closed
pbnj opened this issue Jul 29, 2022 · 7 comments · Fixed by #130
Closed

[Feature] Allow filter with no limits, like fzf --multi. #25

pbnj opened this issue Jul 29, 2022 · 7 comments · Fixed by #130

Comments

@pbnj
Copy link

pbnj commented Jul 29, 2022

Problem

I am trying to achieve something similar to fzf --multi functionality where I can pipe/filter output from one program through gum for (1) fuzzy-finding and (2) selecting multiple options.

I can accomplish one or the other, like:

  • gum choose --no-limit but I cannot fuzzy search, or
  • gum filter but I cannot select multiple options.

Info

$ brew info gum
charmbracelet/tap/gum: stable 0.1.0

Repro Steps

$ echo -e "abc\ndef\nghi\njkl\nmno\npqr\nstu\nvwx\nyz" | gum choose --no-limit
# cannot type anything
$ echo -e "abc\ndef\nghi\njkl\nmno\npqr\nstu\nvwx\nyz" | gum filter
# cannot select multiple options

Possible Solution

Since gum filter already has fuzzy finding algorithm implemented, so it might be a relatively easier lift to implement multi-selection with something like --no-limit (similar to gum choose) and TAB (not SPACE since it could be part of the search pattern/string) to select the current line and move the pointer to the next line.

@pbnj pbnj changed the title "choose" doesn't allow searching. "filter" doesn't allow selecting multiple options. [Feature] Allow filter with no limits, like fzf --multi. Jul 29, 2022
@Nickiel12
Copy link
Contributor

I would also like a feature like this, because the fuzzy feature is awesome.
Maybe the selected items could be stickied to the top of the search results? I don't know.

@maaslalani
Copy link
Member

Hey, thank you for this very well written issue ❤️

The proposal sounds very reasonable to me!

@maaslalani
Copy link
Member

This is now implemented in #130 thanks to @fedeztk!

gum filter --no-limit

@miridius
Copy link

May I request that this be added to the README? I tried gum filter --no-limit on a hunch and could see that it was possible to select multiple but couldn't figure out how to select them! Drove me crazy until I found this PR 😄

@maaslalani
Copy link
Member

Ah yes! Adding this to the README right now, thank you @miridius!

@vogler
Copy link

vogler commented Nov 18, 2022

Adding this to the README right now

It doesn't mention tab.

Also, it's not ideal that gum choose only works with space and not tab.
I use both in a script - would be nicer to just tell people in the beginning that they can select multiple items with tab.

@vogler
Copy link

vogler commented Nov 18, 2022

Ok, just saw #200 and that it's not released yet.

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

Successfully merging a pull request may close this issue.

5 participants