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 request: Interactively change fzf height #3356

Open
5 of 10 tasks
cohml opened this issue Jul 4, 2023 · 2 comments
Open
5 of 10 tasks

Feature request: Interactively change fzf height #3356

cohml opened this issue Jul 4, 2023 · 2 comments

Comments

@cohml
Copy link

cohml commented Jul 4, 2023

  • 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

Please close if this is a duplicate of #3298, I couldn't really understand the description.

It would be really nice to interactively change the height of the fzf window (e.g., via --bind), rather than hardcoding it via options. The specific use case in mind I have is with --preview using tree, where for deep trees it would be great to toggle how much you can see.

@LangLangBart
Copy link
Contributor

  • would that work for you as a verbose workaround ?
    • upon ⌃ Control + A it should open a new fzf process and still have the same selected line, query input, appearances and functionalities, but with a larger height
FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --preview 'tree -C {}' --prompt 'Directories > '" \
    FZF_DEFAULT_COMMAND="fd --type directory" \
    fzf --height '10%' \
        --bind 'ctrl-a:become:pos=$(({n} + 1));fzf --query {q} --height "100%" --bind "load:pos:$pos"'

PS: see man fzf for explanations; {n} starts at zero, thus pos=$(({n} + 1))

@junegunn
Copy link
Owner

Please close if this is a duplicate of #3298, I couldn't really understand the description.

Which part of the answer did you not understand? Nothing's changed, and I'll have to repeat it again.

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

No branches or pull requests

3 participants