Using fzf v0.17.4 on Debian 9.5 (stretch), completion and CTRL+r does not trigger fzf. Installing on debian with apt install fzf does not create any ~/.fzf.zsh or ~/.fzf.bash, which might be the culprit.
- Is this expected or is there a bug in the install script?
- Is there a workaround to enable completion and history search?
Afaik there is no fzf-package in the Debian repositories. Query with apt search fzf don't find anything fzf related (Debian Stretch), so you might use an inoffical package.
It seems there is one in sid:
dpkg -s fzf
Package: fzf
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 2569
Maintainer: Mo Zhou cdluminate@gmail.com
Architecture: amd64
Version: 0.17.4-2
Description: general-purpose command-line fuzzy finder
It's an interactive Unix filter for command-line that can be used with
any list; files, command history, processes, hostnames, bookmarks, git
commits, etc.
.
Refer /usr/share/doc/fzf/README.Debian for quick instructions on how to
add keybindings for Bash, Zsh, Fish to call fzf.
Built-Using: golang-1.10 (= 1.10.3-1), golang-github-mattn-go-isatty (= 0.0.3-4), golang-github-mattn-go-runewidth (= 0.0.2+git20170510.3.97311d9-1), golang-github-mattn-go-shellwords (= 1.0.3-1), golang-go.crypto (= 1:0.0~git20180614.a8fb68e-1), golang-golang-x-sys (= 0.0~git20180510.7dfd129-1)
Homepage: https://github.com/junegunn/fzf
apt-cache showpkg fzf
Package: fzf
Versions:
0.17.4-2 (/var/lib/apt/lists/ftp.us.debian.org_debian_dists_sid_main_binary-amd64_Packages) (/var/lib/apt/lists/httpredir.debian.org_debian_dists_testing_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Description Language:
File: /var/lib/apt/lists/ftp.us.debian.org_debian_dists_sid_main_binary-amd64_Packages
MD5: a0bfeecf96a19354d63fcb504b7530c9
Description Language:
File: /var/lib/apt/lists/ftp.us.debian.org_debian_dists_sid_main_binary-i386_Packages
MD5: a0bfeecf96a19354d63fcb504b7530c9
Description Language: en
File: /var/lib/apt/lists/ftp.us.debian.org_debian_dists_sid_main_i18n_Translation-en
MD5: a0bfeecf96a19354d63fcb504b7530c9Reverse Depends:
fzf:i386,fzf
Dependencies:
0.17.4-2 - fzf:i386 (32 (null))
Provides:
0.17.4-2 -
Reverse Provides:
Were you aware of this package by @cdluminate? They seem to be maintaining quite a few debian packages.
Apart from the question of this package and its maintainance status, is there a way to manually enable completion/history search in zsh? I looked at install but wasn't sure how to apply it manually on an existing installation.
I just uploaded the fzf package to Debian unstable several weeks ago. Debian Stretch doesn't have this package in official repo.
BTW, as per Debian policy, installing stuff such as .fzf.zsh to user's home directory is not allowed. Third-party debian packages can do whatever they want. However it's impossible for an official Debian package to touch your home directory.
@cdluminate thanks for jumping in and for the explanation on this home directory policy.
@durcheinandr, could you advise on the procedure to manually create such .fzf.zsh? I guess we could add them in the README under Installation > Using Debian. Happy to test the procedure on my side and PR the changes if all goes well!
I've managed to work it out with arch wiki: https://wiki.archlinux.org/index.php/Fzf. According to it You need to source two files in order to fzf work with zsh:
Source the desired files from your .zshrc (after vi-mode, if using that, too):
/usr/share/fzf/key-bindings.zsh
/usr/share/fzf/completion.zsh
In Debian those files are:
/usr/share/doc/fzf/examples/key-bindings.zsh
/usr/share/zsh/vendor-completions/_fzf
You need to source them in Yours .zshrc file or it doesn't work. I've tried to put /usr/share/zsh/vendor-completions in fpath before compinit statement, but somehow I need to source that file in order to work (don't know why but I'm no specialist in zsh).
Instruction for the official Debian package is always available here: https://salsa.debian.org/debian/fzf/blob/master/debian/README.Debian
Or /usr/share/doc/fzf/README.Debian after installing the .deb package.
You need to source them in Yours .zshrc file or it doesn't work. I've tried to put
/usr/share/zsh/vendor-completionsin fpath before compinit statement, but somehow I need to source that file in order to work (don't know why but I'm no specialist in zsh).
I made a mistake there and misunderstood the usage of these files. Please refer to the link above for corrected instructions.
@cdluminate
Thanks a lot I got no clue that this is actually there for me ;). This way or another my version of the package only says about sourcing one file:
source /usr/share/doc/fzf/examples/key-bindings.zsh
Nothing about the completion file which in my package is actually in a different place
/usr/share/zsh/vendor-completions/_fzf according to https://packages.debian.org/buster/amd64/fzf/filelist.
If I'm not sourcing second file it doesn't work as expected.
Can confirm that the instructions in /usr/share/doc/fzf/README.Debian (buster) are incorrect as @Fraterius mentions. You need to source both /usr/share/doc/fzf/examples/key-bindings.zsh and /usr/share/zsh/vendor-completions/_fzf.
@cdluminate Are you the package maintainer for FZF in debian? This looks like a bug.
ubuntu 20.04
~ sudo apt install fzf
~ fzf --version
0.20.0
and insert to ~/.zshrc
source /usr/share/doc/fzf/examples/key-bindings.zsh
and ~ source ~/.zshrc
CTRL + r works with fzf now, NO NEED of ruby installation.
BTW, ruby or golang is not necessary here?
@cc978 tried the same on raspberry pi - and it worked
Most helpful comment
ubuntu 20.04
and insert to ~/.zshrc
and
~ source ~/.zshrcCTRL + r works with fzf now, NO NEED of ruby installation.
BTW, ruby or golang is not necessary here?