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 set-pointer to available bind actions #4178

Open
5 of 10 tasks
llakala opened this issue Jan 13, 2025 · 1 comment
Open
5 of 10 tasks

Add set-pointer to available bind actions #4178

llakala opened this issue Jan 13, 2025 · 1 comment

Comments

@llakala
Copy link

llakala commented Jan 13, 2025

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.56.2

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

Most configuration options are toggleable via --bind syntax. From what I can tell, --pointer doesn't have an option like this. I would personally use this for hinting which mode I'm in (I've used bind to setup a faux-vi-mode, where i and escape toggle whether j and k go up/down or not).

@junegunn
Copy link
Owner

I would personally use this for hinting which mode I'm in

fzf 0.59.0 allows you to toggle the input section (prompt + info) and I think you can use it to implement mode switching.

fzf --layout reverse-list --no-input \
    --bind 'j:down,k:up,/:show-input+unbind(j,k,/)' \
    --bind 'enter,esc,ctrl-c:transform:
      if [[ $FZF_INPUT_STATE = enabled ]]; then
        echo "rebind(j,k,/)+hide-input"
      elif [[ $FZF_KEY = enter ]]; then
        echo accept
      else
        echo abort
      fi
    '

The presence of the input section should be a clear indicator of the mode you're in. Do you still feel the need to change the pointer?

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

2 participants