This directory contains the modular configuration files for the Zsh environment.
~/.zshrc
: This file is kept minimal. Its main purpose is to load the automatically generated sourcing block (generated_rc_sourcing.zsh
).~/.zprofile
: This file is loaded only by login shells. It should containexport VAR=value
statements needed for the entire login session (including GUI applications). It should not source~/.zshrc
.~/.shellx/
: This directory holds the actual configuration logic, broken down into smaller, manageable.zsh
files.
00_startup.zsh
: Contains commands that must run at the absolute beginning of the Zsh interactive setup (e.g., Powerlevel10k instant prompt). Keep this file minimal and fast.99_shutdown.zsh
: Contains commands that should run at the very end of the Zsh setup process.p10k_loader.zsh
: Loader that sources the Powerlevel10k configuration file fromconfigs/p10k.zsh
.configs/p10k.zsh
: Contains the actual Powerlevel10k configuration with custom settings for a minimal, clean prompt.
Convenience aliases are available to help maintain the shellx setup:
shellx_help
: Display all available management commands, aliases, and functionsreset_shellx
: Run all generators and reset~/.zshrc
to a minimal loadergen_rc
: Regenerate the sourcing block (use after adding/removing/renaming files)gen_comps
: Regenerate completions (use after modifying aliases or functions)antigen_clean
: Perform a clean install of Antigen and all plugins
Several scripts help maintain the configuration automatically:
-
generate_rc_sourcing.sh
:- Purpose: Scans this directory for
.zsh
files and generates thegenerated_rc_sourcing.zsh
file, which defines the order in which configuration files are sourced by~/.zshrc
. - Order: It sources
00_startup.zsh
first, then files listed in its internalpreferred_order
array, then any remaining.zsh
files alphabetically, and finally99_shutdown.zsh
. - Alias:
gen_rc
- Purpose: Scans this directory for
-
generate_completions.sh
:- Purpose: Scans
aliases.zsh
andfunctions.zsh
to automatically generate basic Zsh completion definitions (compdef
lines) into thegenerated_completions.zsh
file. - Alias:
gen_comps
- Purpose: Scans
-
reset_shellx_setup.sh
:- Purpose: Runs all generators and resets
~/.zshrc
to a minimal loader that properly sources the generated configuration. - Alias:
reset_shellx
- Purpose: Runs all generators and resets
-
clean_install_antigen.sh
:- Purpose: Performs a clean installation of Antigen and all plugins by removing the existing Antigen directory and caches.
- Alias:
antigen_clean
These files contain the main parts of the shell configuration. The sourcing order
is determined by generate_rc_sourcing.sh
.
env_vars.zsh
: Basic environment variables (EDITOR
,LANG
, etc.).path.zsh
: Base PATH setup.nvm.zsh
: Node Version Manager setup.tools.zsh
: Setup for other development tools (Homebrew, pyenv, Bun, etc.).settings.zsh
: Core Zsh options (setopt
), history settings, navigation aliases, andcompinit
(completion system initialization).functions.zsh
: Custom shell functions and theshellx_help
function. Also includessilent_activate
for Python virtual environments.aliases.zsh
: Custom shell aliases and management command aliases.antigen.zsh
: Zsh plugin manager (Antigen) setup.direnv.zsh
: Direnv hook setup with silenced output to prevent prompt issues.generated_completions.zsh
: (Generated) Containscompdef
lines created bygenerate_completions.sh
. Do not edit directly.generated_rc_sourcing.zsh
: (Generated) Contains thesource
commands executed by.zshrc
. Do not edit directly.
- The module loading order is important!
direnv.zsh
is loaded beforeantigen.zsh
(which loads Powerlevel10k) to prevent prompt warnings. - Powerlevel10k is configured for a minimal, clean prompt with transient prompt enabled.
- Use the
venv
alias to activate Python virtual environments without triggering warnings.
ANTIDOTE-MIGRATION.md
: Guide for migrating from Antigen to Antidote, a faster and more modern Zsh plugin manager.
- Add/edit specific configurations in the relevant
.zsh
file. - If you added/removed/renamed a
.zsh
file, rungen_rc
. - If you changed aliases or functions, run
gen_comps
. - To see all available commands, run
shellx_help
. - For a clean Antigen plugin install, run
antigen_clean
.
(Note: The generator scripts use Zsh-specific features. Linters like ShellCheck might show warnings because they don't fully support Zsh, but the scripts should function correctly.)