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

Ctrl+r search seems to overridden #288

Closed
3 tasks done
xconverge opened this issue Jan 8, 2023 · 12 comments
Closed
3 tasks done

Ctrl+r search seems to overridden #288

xconverge opened this issue Jan 8, 2023 · 12 comments
Labels
not a bug The issue is not a bug within fzf.fish

Comments

@xconverge
Copy link

Before proceeding...

Describe the bug

I did not have fzf_configure_bindings in my config previously because I never customized anything. Now that fish added a newer default ctrl+r implementation I am unsure how to have the fzf implementation be the default version. I tried putting fzf_configure_bindings in my config but it doesn't work, I need to manually execute fzf_configure_bindings to restore the keybinding for the fzf version.

This doesnt seem to be working for me in the fzf.fish config

# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
fzf_configure_bindings

Steps to reproduce

Install fzf
Install fish 3.6.0+
ctrl+r to use new fish reverse search
fzf_configure_bindings
ctrl+r to use fzf version of reverse search

Environment

Versions installed:

  • Fish: 3.6.0
  • fzf.fish: latest

Which, if any, configuration variables such as fzf_preview_file_cmd are set?

Additional context

fish-shell/fish-shell#9089

@PatrickF1
Copy link
Owner

PatrickF1 commented Jan 8, 2023

Hi, yeah that comment is out of date. I did not foresee fish releasing their own reverse-i-search. Now, you need to put fzf_configure_bindings --history= in your config.fish to use Ctrl+R for the default. fzf_configure_bindings --help has more info.

FWIW, yesterday I tried the default reverse-i-search and I decided I'll stick with fzf.fish's because it's much better.

@xconverge
Copy link
Author

Hi, yeah that comment is out of date. I did not foresee fish releasing their own reverse-i-search. Now, you need to put fzf_configure_bindings --history= in your config.fish to use Ctrl+R for the default. fzf_configure_bindings --help has more info.

FWIW, yesterday I tried the default reverse-i-search and I decided I'll stick with fzf.fish's because it's much better.

I came to the same conclusion regarding fzf.fish's vs this new one :)

Thanks, will use this in my config!

@xconverge
Copy link
Author

Sorry, I misunderstood that setting. I want to do the opposite of what --history= is doing

On my system, fzf_configure_bindings in my config is not taking over the default so I am stuck with the default fish implementation, I have to run it manually after startup

@PatrickF1
Copy link
Owner

On my system, fzf_configure_bindings in my config is not taking over the default so I am stuck with the default fish implementation, I have to run it manually after startup

Oh I see, sorry I misunderstood the issue. Hmmm that is a bug indeed. Let me get back to you...

@PatrickF1
Copy link
Owner

So when you run bind, do you see bind -M insert \cr _fzf_search_history several lines below bind --preset \cr history-pager?

@xconverge
Copy link
Author

I do not see that exact line, but I do see some \cr entries so I would expect them to be overriden?, I see

bind --preset \cr history-pager
bind --preset \e\ ep fish_clipboard_paste
bind \e\cf _fzf_search_directory
bind \e\cl _fzf_search_git_log
bind \e\cs _fzf_search_git_status
bind \cr fzf-history-widget
bind \e\cp _fzf_search_processes
bind \cv '_fzf_search_variables (set --show | psub) (set --names | psub)'
bind -M insert \e\cf _fzf_search_directory
bind -M insert \e\cl _fzf_search_git_log
bind -M insert \e\cs _fzf_search_git_status
bind -M insert \cr fzf-history-widget
bind -M insert \e\cp _fzf_search_processes
bind -M insert \cv '_fzf_search_variables (set --show | psub) (set --names | psub)'
bind \ct fzf-file-widget
bind \ec fzf-cd-widget
bind -M insert \ct fzf-file-widget
bind -M insert \ec fzf-cd-widget

@PatrickF1
Copy link
Owner

PatrickF1 commented Jan 8, 2023

I see bind -M insert \cr fzf-history-widget, which comes from a different fzf plugin. The one that ships with fzf. Would recommend uninstalling that. That might be what is overriding fzf.fish's version. See the second line of https://github.com/PatrickF1/fzf.fish/wiki/Troubleshooting#default-or-custom-key-bindings-do-not-work.

@xconverge
Copy link
Author

xconverge commented Jan 8, 2023

I see, this plugin relies on fzf based on the documentation, and I am using homebrew to install https://formulae.brew.sh/formula/fzf which is causing the problems as you mentioned

Does this mean I need to explicitly unbind this from the other instance and figure out how that syntax works?

I looked at the referenced lines you mentioned and cant find an obvious "add this to config to force override" anywhere

@PatrickF1
Copy link
Owner

PatrickF1 commented Jan 8, 2023

I think you probably ran $(brew --prefix)/opt/fzf/install and that's the issue. You have to uninstall it now: /opt/homebrew/opt/fzf/uninstall (depending on the output of brew --prefix)

@xconverge
Copy link
Author

Great, this seems to work for me, I had done that ages ago, thanks and have a nice day!

@PatrickF1
Copy link
Owner

No problem! I need to make this more obvious in the docs NOT to install that and how to install it. Learned something today, thanks.

@xconverge
Copy link
Author

@PatrickF1 PatrickF1 changed the title Fish now supports a new version of a ctrl+r search by default which seems to cause key binding collision Ctrl+r search seems to overridden Jan 9, 2023
@PatrickF1 PatrickF1 added the not a bug The issue is not a bug within fzf.fish label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug The issue is not a bug within fzf.fish
Projects
None yet
Development

No branches or pull requests

2 participants