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

Fuzzy completion example from wiki is not working #1119

Open
2 of 15 tasks
jan-warchol opened this issue Nov 1, 2017 · 7 comments
Open
2 of 15 tasks

Fuzzy completion example from wiki is not working #1119

jan-warchol opened this issue Nov 1, 2017 · 7 comments

Comments

@jan-warchol
Copy link
Contributor

  • Category
    • fzf binary
    • fzf-tmux script
    • Key bindings
    • Completion
    • Vim
    • Neovim
    • Etc.
  • OS
    • Linux
    • Mac OS X
    • Windows
    • Windows Subsystem for Linux
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

I'm trying to define custom shell completion using example from wiki, and it doesn't work from me. I've put the definition of _fzf_complete_doge and complete -F _fzf_complete_doge -o default -o bashdefault doge in a script and sourced it. But when I try doge <TAB> (or doge **<TAB>) I get default bash path completion. This is GNU bash, version 4.3.48(1)-release.

@diegoholiveira
Copy link

I'm having the same issue.

I use brew to install fzf and I do follow each instruction of the /usr/local/opt/fzf/install.

The ** trigger just doesn't work. I'm using the 4.4.12 bash version and the iterm2.

@joeminicucci
Copy link

joeminicucci commented Apr 3, 2019

I'm having the same issue only Im using ZSH w/ various terminal emulators

@xulongwu4
Copy link

I had the same problem by installing with a package manager. Then I solved the problem by explicitly sourcing the completion shell file in my shell-rc file.

@msdrigg
Copy link

msdrigg commented Jun 22, 2021

My issue was package manager installation. If you run apt-cache show fzf or equivalent, there is instructions in the description for how to setup auto-completions and keyboard shortcuts.

faruzzy added a commit to faruzzy/dotfiles that referenced this issue Jan 5, 2022
It appears that installing fzf via brew cause an issue where
the functionality that uses the completion trigger don't work.
The solution is to explicitly source those completion files.
junegunn/fzf#1119 (comment)
@bjacques
Copy link

bjacques commented Jan 5, 2023

Fuzzy completion like cd /** wasn't working for me. I didn't see a file named completion.bash that I could source (although there is a file for .zsh) and it's not clear whether my version of fzf is supposed to have the auto-completion working by default or not

$ sudo apt install fzf

$ fzf --version
0.29 (devel)

$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

$ ll /usr/share/doc/fzf/examples/
-rw-r--r-- 1 root root 10770 Dec 25  2021 completion.zsh
-rw-r--r-- 1 root root 30960 Dec 25  2021 fzf.vim
-rw-r--r-- 1 root root  3767 Dec 25  2021 key-bindings.bash
-rw-r--r-- 1 root root  5727 Dec 25  2021 key-bindings.fish
-rw-r--r-- 1 root root  3590 Dec 25  2021 key-bindings.zsh
drwxr-xr-x 2 root root  4096 Jan  4 19:30 plugin/

$ cat /usr/share/doc/fzf/README.Debian
...
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

I was able to solve my auto-completion issue by manually downloading this source file completion.bash and adding it as described. I added the following lines to my .bashrc file

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

@junegunn
Copy link
Owner

junegunn commented Jan 5, 2023

@bjacques See #2790

@praxder
Copy link

praxder commented Feb 13, 2023

I ran into this issue because I was using FZF in combination with iTerm2 and Oh-My-Zsh. I had placed the [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh above the source of oh-my-zsh in my .zshrc file and that messed up FZF. When I placed the FZF source below the oh-my-zsh source, FZF started working (and oh-my-zsh still works too).

@junegunn junegunn mentioned this issue Feb 16, 2023
10 tasks
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

8 participants