12

I've installed fzf on debian 11 (bullseye). When I type in ctrl-r to trigger a history search, nothing happens. Works fine on my mac. I'm using zsh.

UPDATE: tried adding bindkey '^r' fzf-history-widget to .zshrc but I just get a "no such widget" error.

fzf --version reports 0.24 (devel)

StevieD
  • 855
  • 2
  • 10
  • 23

3 Answers3

27

OK, found the answer at https://packages.debian.org/bullseye/fzf which says to refer to README file:

Bash
====

Append this line to ~/.bashrc to enable fzf keybindings for Bash:

   source /usr/share/doc/fzf/examples/key-bindings.bash

Append this line to ~/.bashrc to enable fuzzy auto-completion for Bash:

   source /usr/share/doc/fzf/examples/completion.bash

Zsh
===

Append this line to ~/.zshrc to enable fzf keybindings for Zsh:

   source /usr/share/doc/fzf/examples/key-bindings.zsh

Append this line to ~/.zshrc to enable fuzzy auto-completion for Zsh:

   source /usr/share/doc/fzf/examples/completion.zsh

Fish
====

Issue the following commands to enable fzf keybindings for Fish:

   mkdir -p ~/.config/fish/functions/
   echo fzf_key_bindings > ~/.config/fish/functions/fish_user_key_bindings.fish

Vim
===

The straightforward way to use fzf.vim is appending this line to your vimrc:

   source /usr/share/doc/fzf/examples/fzf.vim
StevieD
  • 855
  • 2
  • 10
  • 23
  • and `fish_user_key_bindings.fish` should contain the function, as declared here: https://github.com/junegunn/fzf/blob/master/shell/key-bindings.fish – Ivan Aracki Mar 20 '22 at 18:15
  • In archlinux the path is `/usr/share/fzf/key-bindings.bash` – Neoecos Apr 18 '23 at 18:09
2

This plugin also does the trick either via zinit or oh-my-zsh https://github.com/joshskidmore/zsh-fzf-history-search

0

This might not be relevant to this stack exchange, but on an M1 mac, I found the key-bindings.zsh file in: /opt/homebrew/Cellar/fzf/0.36.0/shell/key-bindings.zsh.

By adding this file to my .zshrc I was able to get Ctrl+r working with fzf.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
Bruno Robert
  • 101
  • 1