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

Make counsel-fzf accept multiple search terms #1544

Closed
niklascarlsson opened this issue Apr 28, 2018 · 4 comments

Comments

@niklascarlsson
Copy link

commented Apr 28, 2018

As an avid user of fzf in the terminal and vim I would love to see the possibility of counsel-fzf accepting multiple search terms.

As described on https://github.com/junegunn/fzf
"Unless otherwise specified, fzf starts in "extended-search mode" where you can type in multiple search terms delimited by spaces. e.g. ^music .mp3$ sbtrkt !fire "

This makes it possible to fuzzy match against multiple search terms and also specify match types such as ! for inverse exact match.

Currently counsel-fzf prints "error code 2" when multiple search terms are inserted with a space as delimiter.

@abo-abo

This comment has been minimized.

Copy link
Owner

commented May 3, 2018

Please give me a sample full command line input. I'm getting now:

$ fzf -f foo bar
unknown option: bar
@niklascarlsson

This comment has been minimized.

Copy link
Author

commented May 3, 2018

If I make a directory that contains the following files:

foo # 1)
foo_bar # 2)
foo_bar_baz  # 3)

Then I can do the following searches

fzf -f "foo" #finds all three files
fzf -f "foo bar" # finds 2) and 3)
fzf -f "foo baz" # finds 3)
fzf -f "\!bar" # finds 1)

When using fzf without the -f flag, but instead through the default ctrl-t command then the exclamation doesn't need to be escaped, I don't know if that is possible to integrate in counsel-fzf, otherwise escaping it manually is not that hard :)

@abo-abo abo-abo closed this in 6c38884 May 7, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented May 7, 2018

Thanks, please test.

@niklascarlsson

This comment has been minimized.

Copy link
Author

commented May 8, 2018

Nice fix! Works like fzf in the terminal now, that's awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.