Architecture & Precedence
Repository Layout
txt
zsh-fzf-unified.plugin.zsh # OMZ entry point (resolves plugin root)
zsh-fzf-unified.zsh # all fzf logic: integration, Ctrl-R, arrows, Ctrl-G, fzf-tab styling
zsh-fzf-unified-preview # shared content preview script (dirs/git, images, archives, text, binaries)
vendor/fzf-tab/ # Aloxaf/fzf-tab pinned to 24105b1
LICENSE # MIT
THIRD-PARTY.md # vendored/ported upstream noticesLoad Order & Binding Precedence
Precedence is deterministic inside zsh-fzf-unified.zsh:
- Guard checks:
- Exits immediately if
fzfis missing from$commands. - Exits as a no-op if
zfz_loadedis already set (safe against double-sourcing or multiple keymap setups). - Captures
zfz_home="${0:A:h}"at load time so widgets and previews always resolve bundled assets.
- Exits immediately if
- Base integration (
eval "$(fzf --zsh)"): Installs upstreamCtrl-T,Alt-C,Tab, andCtrl-R. Ctrl-R(fzf_history_search): Rebinds^Rinemacs,viins, andvicmdso the multiline-safe history search wins overfzf --zsh.- Hybrid
Up/Downarrows (zfz_up/down-line-or-history): Bound acrossemacs,viins, andvicmd(plus${terminfo[kcuu1]}and${terminfo[kcud1]}when present). - Vendored
fzf-tab(vendor/fzf-tab/fzf-tab.plugin.zsh): Loaded afterfzf --zshsofzf-tabwins^I(Tab), followed by allzstyle ':fzf-tab:*'rules. - Global
FZF_*variables: SetsFZF_CTRL_R_OPTS,FZF_CTRL_T_OPTS,FZF_ALT_C_OPTS,FZF_DEFAULT_OPTS, andFZF_DEFAULT_COMMAND. - Live ripgrep (
zfz_rg): Binds^Gacrossemacs,viins, andvicmd.
Line Endings (.gitattributes)
The repository enforces * text=auto eol=lf in .gitattributes, because zsh/bash treat trailing carriage returns in scripts and ANSI helpers as data rather than whitespace.
Updating Vendored fzf-tab
Aloxaf/fzf-tab is vendored in vendor/fzf-tab/ and pinned to commit 24105b1:
sh
curl -sL https://github.com/Aloxaf/fzf-tab/archive/<sha>.tar.gz | \
tar xz --strip-components=1 -C vendor/fzf-tab --exclude='.git'