Aloxaf / fzf-tab

Replace zsh's default completion selection menu with fzf!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Q] Is there a quick way to tell whether build-fzf-tab-module has already been run?

cohml opened this issue · comments

When I execute build-fzf-tab-module, it takes a long time to run. Like a full minute or more!

Unfortunately - and without going into lots of needless detail that's specific to me - my dotfiles end up executing build-fzf-tab-module somewhat frequently.

So what I'd love is an easy way to deduce whether or not build-fzf-tab-module has already been executed, so that I can skip it if it's not necessary.

Is this possible to do?

You can check whether FZF_TAB_MODULE_VERSION variable exists.

fzf-tab/fzf-tab.zsh

Lines 399 to 408 in b06e757

if [[ $FZF_TAB_MODULE_VERSION != "0.2.2" ]]; then
zmodload -u aloxaf/fzftab
local rebuild
print -Pn "%F{yellow}fzftab module needs to be rebuild, rebuild now?[Y/n]:%f"
read -q rebuild
if [[ $rebuild == y ]]; then
build-fzf-tab-module
zmodload aloxaf/fzftab
fi
fi