Skip to content

Extract FZF config into configs/shared/fzf.zsh and load p10k last#15

Merged
ChangeHow merged 3 commits intodevfrom
copilot/sub-pr-10-one-more-time
Mar 11, 2026
Merged

Extract FZF config into configs/shared/fzf.zsh and load p10k last#15
ChangeHow merged 3 commits intodevfrom
copilot/sub-pr-10-one-more-time

Conversation

Copy link

Copilot AI commented Mar 10, 2026

The fzf-config append block extracted FZF env vars from tools.zsh by splitting on a comment string (# Tool initialization), silently breaking if that comment ever changed. Additionally, the Powerlevel10k theme was being loaded in the suitup stage instead of as the final step.

Changes

  • configs/shared/fzf.zsh — new standalone file holding only FZF_DEFAULT_COMMAND, FZF_CTRL_T_COMMAND, and FZF_CTRL_T_OPTS
  • configs/shared/tools.zsh — FZF vars removed; replaced with an inline conditional source of fzf.zsh (avoids source_if_exists dependency):
    [[ -f "${ZDOTDIR:-$HOME/.config/zsh}/shared/fzf.zsh" ]] && source "${ZDOTDIR:-$HOME/.config/zsh}/shared/fzf.zsh"
  • src/append.jsfzf-config block reads fzf.zsh directly via readFileSync instead of parsing tools.zsh
  • src/steps/zsh-config.jsfzf.zsh added to sharedFiles so it's copied to ~/.config/zsh/shared/ during setup
  • configs/zinit-plugins — removed zinit light romkatv/powerlevel10k so p10k is no longer loaded in the suitup stage (step 7)
  • configs/shared/prompt.zsh — now loads the p10k theme as the very last step (prompt stage, step 9), guarded with (( ${+functions[zinit]} )) so it is a no-op for OMZ setups where p10k is handled by OMZ itself
  • Tests — 6 new cases in append.test.js assert fzf.zsh exists standalone, contains only FZF vars (no cache helpers), and that the appended block is idempotent; configs.test.js updated to assert p10k is in prompt.zsh (not zinit-plugins) and setup.test.js asserts prompt.zsh is sourced after zinit-plugins in the template loading order

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…g splitting

Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP addressing review feedback for modular Node CLI migration Extract FZF config into configs/shared/fzf.zsh Mar 10, 2026
@ChangeHow
Copy link
Owner

@copilot p10k(theme) would be the last process of all the tasks.

Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com>
@ChangeHow ChangeHow marked this pull request as ready for review March 11, 2026 01:32
Copy link
Author

Copilot AI commented Mar 11, 2026

@copilot p10k(theme) would be the last process of all the tasks.

Done in 2f0362a. Moved zinit light romkatv/powerlevel10k out of configs/zinit-plugins (suitup stage) and into configs/shared/prompt.zsh (prompt stage — the last step before _zsh_report). It's guarded with (( ${+functions[zinit]} )) so it's a no-op for OMZ setups where p10k is already loaded by OMZ itself.

Copilot AI changed the title Extract FZF config into configs/shared/fzf.zsh Extract FZF config into configs/shared/fzf.zsh and load p10k last Mar 11, 2026
@ChangeHow
Copy link
Owner

/gemini summary

@gemini-code-assist
Copy link

Summary of Changes

This pull request refactors the Zsh configuration management by extracting FZF-related environment variables into a dedicated file, fzf.zsh, and updating the build process to handle this new structure. It also addresses an issue with Powerlevel10k theme loading by ensuring it is initialized as the final step in the Zsh startup sequence, improving reliability and consistency across different Zsh setups. These changes enhance the modularity, maintainability, and robustness of the Zsh configuration.

Highlights

  • FZF Configuration Extraction: FZF environment variables and options were moved from configs/shared/tools.zsh into a new dedicated file, configs/shared/fzf.zsh, to improve modularity and prevent brittle parsing.
  • Powerlevel10k Loading Order: The Powerlevel10k theme loading was moved from configs/zinit-plugins to configs/shared/prompt.zsh, ensuring it loads as the very last step in the Zsh initialization process and is guarded for zinit-based setups.
  • Improved FZF Block Appending: The src/append.js logic for the fzf-config block was updated to directly read the new fzf.zsh file, eliminating the previous fragile string splitting approach.
  • Enhanced Test Coverage: New and updated tests were added across append.test.js, configs.test.js, setup.test.js, and zsh-config-steps.test.js to validate the new FZF configuration structure, Powerlevel10k loading order, and the robustness of the appending mechanism.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • configs/shared/fzf.zsh
    • Added as a new file containing FZF_DEFAULT_COMMAND, FZF_CTRL_T_COMMAND, and FZF_CTRL_T_OPTS.
  • configs/shared/prompt.zsh
    • Modified to include zinit-based Powerlevel10k loading as the final step, guarded by a function check.
  • configs/shared/tools.zsh
    • Updated to remove FZF environment variable definitions and conditionally source fzf.zsh.
  • configs/zinit-plugins
    • Removed the zinit light romkatv/powerlevel10k line, delegating p10k loading to prompt.zsh.
  • src/append.js
    • Changed the fzf-config block's apply method to read fzf.zsh directly instead of parsing tools.zsh.
  • src/steps/zsh-config.js
    • Added fzf.zsh to the sharedFiles array to ensure it is copied during setup.
  • tests/append.test.js
    • Introduced new tests for fzf.zsh content, tools.zsh not containing FZF vars, and the idempotency and direct appending of the fzf-config block.
  • tests/configs.test.js
    • Updated assertions for zinit-plugins (no p10k), prompt.zsh (p10k loaded last), and confirmed fzf.zsh existence and content.
  • tests/setup.test.js
    • Added checks to ensure prompt.zsh is sourced after zinit-plugins in the generated .zshrc.
  • tests/zsh-config-steps.test.js
    • Verified that fzf.zsh is copied and its content is correctly set up in the sandbox environment.
Activity
  • ChangeHow requested that the p10k theme be the absolute last process.
  • Copilot confirmed the request was addressed by moving zinit light romkatv/powerlevel10k from configs/zinit-plugins to configs/shared/prompt.zsh, ensuring it loads in the prompt stage (the last step before _zsh_report), and added a guard for OMZ setups.

@ChangeHow ChangeHow merged commit e200c08 into dev Mar 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants