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

No-filter search option #1723

Closed
1 of 7 tasks
jbriales opened this issue Oct 19, 2019 · 2 comments
Closed
1 of 7 tasks

No-filter search option #1723

jbriales opened this issue Oct 19, 2019 · 2 comments
Labels
Milestone

Comments

@jbriales
Copy link
Contributor

  • Category
    • fzf binary
    • fzf-tmux script
    • Key bindings
    • Completion
    • Vim
    • Neovim
    • Etc.

Context

I've playing around using fzf as a result visualization tool rather than a filter.
I know, I know this is not what the tool is for, checked #974.
Yet the interface and preview capabilities of fzf are awesome enough so that it'd be worth for me to try to hack my way here to visualize the search results of a custom SQLite search tool based on query value inside fzf.
So I used the snippet provided in #974 and it works!
Although I had to get extra-hacky as I do NOT want fzf to filter the lines passed to it. I just want to display all of them, regardless of the current query value inside fzf.

Proposal

So my question/proposal is: Would it be possible to add an additional 'Search' option like --no-filter which basically would deactivate the search/filtering?

As I said, I do know fzf is not for this, and @junegunn has made clear simplicity of the tool is paramount.
Yet I feel this would be a really simple and straightforward option. Should be just almost just an if-check based on the option --no-filter to run the filter logic or not (although I acknowledge I'm not familiar enough with the code to know for sure :)).
And also I feel like this option would be an excellent companion for the hack that @junegunn proposed back in #974 to hackily leverage fzf as interface from a changing source :)

The hack

Just for curiosity, this is the hack I had to do for avoiding filtering results:

@junegunn junegunn added this to the 0.19.0 milestone Nov 9, 2019
junegunn added a commit that referenced this issue Nov 10, 2019
  # Reload input list with different sources
  seq 10 | fzf --bind 'ctrl-a:reload(seq 100),ctrl-b:reload(seq 1000)'

  # Reload as you type
  seq 10 | fzf --bind 'change:reload:seq {q}' --phony

  # Integration with ripgrep
  RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
  INITIAL_QUERY=""
  FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \
    fzf --bind "change:reload:$RG_PREFIX {q} || true" \
        --ansi --phony --query "$INITIAL_QUERY"

Close #751
Close #965
Close #974
Close #1736
Related #1723
@junegunn
Copy link
Owner

@jbriales
Copy link
Contributor Author

Awesome! Looking forward to give it a try. Thanks @junegunn !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants