junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
65.15k stars 2.4k forks source link

README.Debian says to source /usr/share/doc/fzf/examples/completion.bash, but file no longer exists #2790

Open studgeek opened 2 years ago

studgeek commented 2 years ago

Info

Problem / Steps to reproduce

README.Debian says to source /usr/share/doc/fzf/examples/completion.bash, but file no longer exists.

$ cat /usr/share/doc/fzf/README.Debian
Bash
====

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

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

Note, since fzf 0.29.0-1, the bash completion is installed for bash
by default. Feel free to ignore the following instruction for fzf >= 0.29.0-1.
Append this line to ~/.bashrc to enable fuzzy auto-completion for Bash:

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

...
9$ ls /usr/share/doc/fzf/examples/completion.bash
ls: cannot access '/usr/share/doc/fzf/examples/completion.bash': No such file or directory
mdtrooper commented 2 years ago

I have the same bug. I paste more info:

bash: /usr/share/doc/fzf/examples/completion.bash: No such file or directory
miguel@speccy-laptop:~$ 
$ dpkg -l | grep fzf
ii  fzf                                    0.30.0-1+b1                        amd64        general-purpose command-line fuzzy finder
$ lsb_release --all
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux bookworm/sid
Release:    testing
Codename:   bookworm
$ uname -a
Linux speccy-laptop 5.17.0-1-amd64 #1 SMP PREEMPT Debian 5.17.3-1 (2022-04-18) x86_64 GNU/Linux
$ dpkg -L fzf 
/.
/usr
/usr/bin
/usr/bin/fzf
/usr/bin/fzf-tmux
/usr/share
/usr/share/bash-completion
/usr/share/bash-completion/completions
/usr/share/bash-completion/completions/fzf
/usr/share/doc
/usr/share/doc/fzf
/usr/share/doc/fzf/README.Debian
/usr/share/doc/fzf/changelog.Debian.amd64.gz
/usr/share/doc/fzf/changelog.Debian.gz
/usr/share/doc/fzf/changelog.gz
/usr/share/doc/fzf/copyright
/usr/share/doc/fzf/examples
/usr/share/doc/fzf/examples/completion.zsh
/usr/share/doc/fzf/examples/fzf.vim
/usr/share/doc/fzf/examples/key-bindings.bash
/usr/share/doc/fzf/examples/key-bindings.fish
/usr/share/doc/fzf/examples/key-bindings.zsh
/usr/share/doc/fzf/examples/plugin
/usr/share/fish
/usr/share/fish/vendor_functions.d
/usr/share/fish/vendor_functions.d/fzf_key_bindings.fish
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/fzf-tmux.1.gz
/usr/share/man/man1/fzf.1.gz
/usr/share/doc/fzf/examples/plugin/fzf.vim
FahriDevZ commented 2 years ago

Yesterday its okay, but today i see the same problem. This because files in example directory its does not exist, and only have one directory plugin.

# tree /usr/share/doc/fzf/examples
/usr/share/doc/fzf/examples
└── plugin
    └── fzf.vim -> ../fzf.vim
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

And now i temporarily disable fzf plugins in my .zshrc because the message is very disturbing.

junegunn commented 2 years ago

I'm not the maintainer of the Debian package. You should report the problem to the Debian package maintainers.

FahriDevZ commented 2 years ago

I think this was related 🤔

2480 https://bugs.launchpad.net/ubuntu/+source/fzf/+bug/1928670

travisdowns commented 2 years ago

Isn't the solution right in the quoted text in the README.Debian? Specifically this part:

Note, since fzf 0.29.0-1, the bash completion is installed for bash
by default. Feel free to ignore the following instruction for fzf >= 0.29.0-1.

Running $ dpkg -L fzf shows that the completions are installed directly at: /usr/share/bash-completion/completions/fzf.

My fzf version:

ii  fzf            0.29.0-1     amd64        general-purpose command-line fuzzy finder
lcheylus commented 2 years ago

The Debian documentation in /usr/share/doc/fzf/README.Debian for version 0.30.0 is invalid : file /usr/share/doc/fzf/examples/completion.bash no longer exists in the package. In place, FZF completions is installed by default with /usr/share/bash-completion/completions/fzf => no need to source it in $HOME/.bashrc.

The issue is not a upstream one but should be reported to the Debian package maintainers https://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=fzf

esturniolo commented 2 years ago

I just installed it in pop OS! and the completion file is in the completions dir, but it doesn't work.

image

Am I missing something?

Diablo-D3 commented 2 years ago

I use Debian, this is currently what is in my .bashrc to work on Debian, but also other distros:

  if [ -f /usr/share/bash-completion/completions/fzf ]; then
    source /usr/share/bash-completion/completions/fzf
  fi

  if [ -f /usr/share/doc/fzf/examples/key-bindings.bash ]; then
    source /usr/share/doc/fzf/examples/key-bindings.bash
  fi
mosenturm commented 2 years ago

@Diablo-D3 This works for me at Ubuntu 22.04 too. Thanks!

pjgoodall commented 2 years ago

Failed for me in Ubuntu 22.04 yesterday

pjgoodall commented 2 years ago

I think this was related 🤔

2480 https://bugs.launchpad.net/ubuntu/+source/fzf/+bug/1928670

I cross-referenced this issue into launchpad #2480 above

tonybengue commented 1 month ago

You can also use a shortand condition like:

[ -f /usr/share/doc/fzf/examples/key-bindings.bash ] && source /usr/share/doc/fzf/examples/key-bindings.bash
[ -f /usr/share/doc/fzf/examples/completion.bash ] && source /usr/share/doc/fzf/examples/completion.bash