Aloxaf / fzf-tab

Replace zsh's default completion selection menu with fzf!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] fzf-tab gives a weird error

superNWHG opened this issue · comments

Describe the bug

Hello everyone, I was trying to migrate from oh-my-zsh to no plugin manager, and I used this plugin in oh-my-zsh, but now when I try to use it without oh my zsh, it is not working. It gives me an error: "_ftb__main_complete:143: command not found: _complete
_ftb__main_complete:143: command not found: _ignored" Directly after the letter I try to complete.

I can make sure:

  • this is the minimal zshrc which can reproduce this bug
  • I am using the latest version of fzf-tab
  • fzf-tab is loaded after compinit
  • fzf-tab is loaded after plugins which will wrap Tab, like junegunn/fzf/completion.zsh
  • fzf-tab is loaded before zsh-autosuggestions, zsh-syntax-highlighting and fast-syntax-highlighting.

To Reproduce

Steps to reproduce the behavior:

  1. Type anything
  2. Press Tab
  3. See error: "_ftb__main_complete:143: command not found: _complete
    _ftb__main_complete:143: command not found: _ignored"

Expected behavior

I was expecting to see the fzf-tab just working.

Screenshots

image

Environment:

  • OS: Arch Linux
  • zsh version: 5.9

Minimal zshrc

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

export PATH=$HOME/bin:/usr/local/bin:$PATH

HISTFILE=~/.zsh_history
HISTSIZE=30000
SAVEHIST=30000
setopt appendhistory

source ~/.config/zsh/themes/powerlevel10k/powerlevel10k.zsh-theme

source ~/.config/zsh/plugins/k/k.plugin.zsh
source ~/.config/zsh/plugins/zsh-sudo/zsh-sudo.zsh
source ~/.config/zsh/plugins/zsh-archlinux/archlinux.plugin.zsh
source ~/.config/zsh/plugins/alias-tips/alias-tips.plugin.zsh
source ~/.config/zsh/plugins/fzf-tab/fzf-tab.plugin.zsh
source ~/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
source ~/.config/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

bindkey '^I' 'fzf-tab-complete'
ZSH_AUTOSUGGEST_STRATEGY=(history completion)

if [[ -n $SSH_CONNECTION ]]; then
  export EDITOR='vim'
else
  export EDITOR='nvim'
fi

__conda_setup="$('/home/nico/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/nico/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/home/nico/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/nico/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

zstyle ':completion*:descriptions' format '[%d]'

export MOZ_ENABLE_WAYLAND=1

alias nvim="sudo -E nvim"
alias clear="printf '\033[H\033[2J\033[3J'"
alias clean="yay -Scc && yay -Rns $(yay -Qtdq) && sudo rm -rf ~/.cache/*"
alias ccd="cd && clear"

[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

You can check my working zsh configuration with oh-my-zsh at my dotfiles

Log

I don't know what you mean with C-x?

The issue was fixed by putting this before I load fzf-tab to my .zshrc file:

autoload -Uz compinit
compinit -D