Should fzf shell integration be initialised before or after calling compinit ? #3981
-
Just wondering if the fzf shell integration for zsh
Should come before or after calling compinit ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Example: Setting up # minimal zsh environment
command env -i HOME=$HOME TERM=$TERM USER=$USER LANG=en_US.UTF-8 PATH=$PATH /usr/local/bin/zsh -f
source <(fzf --zsh)
# the FZF_COMPLETION_TRIGGER is by default set to '**'
ls **<TAB> However, in the zsh setup files I've observed, it is placed after Other tools, for example, Example: Setting up command env -i HOME=$HOME TERM=$TERM USER=$USER LANG=en_US.UTF-8 PATH=$PATH /usr/local/bin/zsh -f
source /Users/paria/Developer/fzf-tab-completion/zsh/fzf-zsh-completion.sh
bindkey '^I' fzf_completion
ls <TAB>
# _fzf_completion:93: command not found: _main_complete
autoload -Uz compinit && compinit
ls <TAB> Did you encounter any issues that led you to ask this question? Footnotes |
Beta Was this translation helpful? Give feedback.
fzf
doesn't rely on the default zsh's completion system that is initialised when you callcompinit
12. Therefore, placing it before or aftercompinit
should not matter.Example: Setting up
fzf
completion without callingautoload -Uz compinit && compinit
results in no issues.However, in the zsh setup files I've observed, it is placed after
autoload -U compinit && compinit
, not because it's necessary, but to ensure default user configurations are initialized first. This allows third-p…