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

Add "reload-cycle" action for cycling the source in dynamically updated input list #2204

Closed
3 of 10 tasks
cibinmathew opened this issue Oct 9, 2020 · 2 comments
Closed
3 of 10 tasks
Labels

Comments

@cibinmathew
Copy link

cibinmathew commented Oct 9, 2020

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

Feature Request
Would it be possible to add a functionality to cycle through the list of sources using a single key binding. Existing functionality #1750

eg:
find . -type f | fzf --bind 'ctrl-d:reload-cycle(find . -type d; find . -type f; find .; source#n)'

Instead of separate key for each like below
find . -type f | fzf --bind 'ctrl-d:reload(find . -type d),ctrl-f:reload(find . -type f)'

list of sources could be delimited.

@cibinmathew cibinmathew changed the title Add "reload-cycle" action for dynamically updating the input list Add "reload-cycle" action for cycling the dynamically updated input list Oct 9, 2020
@cibinmathew cibinmathew changed the title Add "reload-cycle" action for cycling the dynamically updated input list Add "reload-cycle" action for cycling the source in dynamically updated input list Oct 9, 2020
@junegunn
Copy link
Owner

junegunn commented Oct 9, 2020

I'm not going to add this to fzf because we can write a script that cycles through a list of commands by keeping its own state in an external file.

rm -f /tmp/script-state
my-script /tmp/script-state | fzf --bind 'ctrl-d:reload:my-script /tmp/script-state'

@cibinmathew
Copy link
Author

Thanks @junegunn
Does it make sense to add these snippets to wiki examples.

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