Aloxaf / fzf-tab

Replace zsh's default completion selection menu with fzf!
MIT License
3.28k stars 94 forks source link

[BUG] fzf-tab gives a weird error #397

Closed superNWHG closed 10 months ago

superNWHG commented 10 months ago

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:

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:

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?

superNWHG commented 10 months ago

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

autoload -Uz compinit
compinit -D
superNWHG commented 10 months ago

Hello, Thank you for responding to my issue and it really worked for me! Nico

Op za 18 nov 2023 om 07:21 schreef Justin Kroes @.***>:

When I see this error, it's usually because I forget to compinit:

autoload -Uz compinit compinit -D source ~/fzf-tab/fzf-tab.plugin.zsh

— Reply to this email directly, view it on GitHub https://github.com/Aloxaf/fzf-tab/issues/397#issuecomment-1817410252, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6HMZLBLPVRDLW34ERCSPKLYFBHVFAVCNFSM6AAAAAA7NZ2JBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXGQYTAMRVGI . You are receiving this because you authored the thread.Message ID: @.***>