Aloxaf / fzf-tab

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

[BUG] fzf-tab not working #487

Closed mirai-toto closed 2 weeks ago

mirai-toto commented 2 weeks ago

Describe the bug

I installed fzf-tab with oh-my-zsh. To troubleshoot the issue, I uninstalled zsh-completions and deleted the oh-my-zsh cache.

I'm not sure if fzf-tab is loading before zsh-autosuggestions and zsh-syntax-highlighting.

My Plugins

plugins=(git fzf fzf-tab zsh-autosuggestions zsh-syntax-highlighting zsh-interactive-cd sudo aliases kubectl docker)

I do not see fzf in the completions.

image

fpath:

> echo $fpath | sed 's/ /\n/g'
/home/hamuto/.oh-my-zsh/plugins/docker
/home/hamuto/.oh-my-zsh/plugins/kubectl
/home/hamuto/.oh-my-zsh/plugins/aliases
/home/hamuto/.oh-my-zsh/plugins/sudo
/home/hamuto/.oh-my-zsh/plugins/zsh-interactive-cd
/home/hamuto/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
/home/hamuto/.oh-my-zsh/custom/plugins/zsh-autosuggestions
/home/hamuto/.oh-my-zsh/custom/plugins/fzf-tab
/home/hamuto/.oh-my-zsh/plugins/fzf
/home/hamuto/.oh-my-zsh/plugins/git
/home/hamuto/.oh-my-zsh/functions
/home/hamuto/.oh-my-zsh/completions
/home/hamuto/.oh-my-zsh/custom/functions
/home/hamuto/.oh-my-zsh/custom/completions
/home/hamuto/.oh-my-zsh/cache/completions
/usr/local/share/zsh/site-functions
/usr/share/zsh/site-functions
/usr/share/zsh/5.9/functions
/home/hamuto/.oh-my-zsh/custom/plugins/fzf-tab/lib

.zshrc:

# Powerlevel10k instant prompt
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

# Path to oh-my-zsh
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="powerlevel10k/powerlevel10k"

# Plugins
plugins=(git fzf fzf-tab zsh-autosuggestions zsh-syntax-highlighting zsh-interactive-cd sudo aliases kubectl docker) 
source $ZSH/oh-my-zsh.sh

# FZF settings
if command -v fzf &>/dev/null; then
  source <(fzf --zsh)
  zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
fi

# Disable untracked files check for faster git status
DISABLE_UNTRACKED_FILES_DIRTY="true"
COMPLETION_WAITING_DOTS="true"

# Aliases and custom PATH
export PATH="$HOME/.local/bin:$HOME/.local/bin/flatpak-links:$PATH"
alias scat="/usr/bin/cat"
alias cat="bat"
alias cv='cat ~/Dev/cheatsheet_vim.md'
alias ct='cat ~/Dev/cheatsheet_tmux.md'
alias vim='nvim'
alias pm='podman'

# PNPM path setup
export PNPM_HOME="$HOME/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"

# Brew
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

# Keybindings
bindkey \^U backward-kill-line

# Powerlevel10k configuration
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

Do you see any issues in this setup or the plugin load order? And also is it completely impossible to use fzf-tab with zsh-completions?

Aloxaf commented 2 weeks ago

Remove zsh-interactive-cd and try again.

mirai-toto commented 2 weeks ago

Thank you.