Shell: Fish
Fish is the primary shell in this setup.
Zsh and Bash are also configured so the environment is usable even if you don't switch your login shell.
Relevant files:
- Bash:
home/readonly_dot_bashrc.tmpl,home/readonly_dot_bash_profile - Zsh:
home/readonly_dot_zshrc.tmpl,home/readonly_dot_zprofile, completions inhome/dot_zsh/completions/ - POSIX profile:
home/readonly_dot_profile.tmpl
Core Configโ
Notable responsibilities in this file:
- sets editor to
nvim - exports
SSH_AUTH_SOCKfor 1Password - configures Homebrew path via
homebrewPrefixprompt data - loads API keys from
passinto environment variables - adds
~/binand~/.local/binto PATH on login
It also initializes a few tools if present:
- Starship prompt (
home/dot_config/readonly_starship.toml) - zoxide (smarter
cd) - fzf integration via
PatrickF1/fzf.fish
Startup Modelโ
Fish setup in this repo is split by shell mode:
- Login shell:
- Adds Homebrew,
~/.local/bin,~/bin, and mise shims toPATH.
- Adds Homebrew,
- Interactive shell:
- Adds aliases (
g,v,c,t, and others). - Defines the
codexfunction, which routes through the managed,codexwrapper. - Initializes prompt/tools (
starship,zoxide,naviwhen installed).
- Adds aliases (
If a command works in one terminal but not another, check whether the shell is login vs non-login.
Non-fish startup files are intentionally side-effect free for secret loading: pass-based API key exports run in fish config, not in home/readonly_dot_profile.tmpl.
Machine-local extrasโ
Each profile sources an optional extra file last, if it exists. Chezmoi does not create or manage these files; keep them out of git.
| Shell | Extra file | Syntax |
|---|---|---|
POSIX login (bash/zsh .profile) | ~/.profile.local | POSIX (export โฆ) |
| Bash interactive | ~/.bashrc.local | bash |
| Zsh interactive | ~/.zshrc.local | zsh |
| Fish | ~/.config/fish/config.local.fish | fish (set -gx โฆ) |
Missing files are a no-op. Prefer chmod 600 when the file holds secrets.
Fish conf.d/ runs before config.fish, so it cannot override managed settings. Put overrides in config.local.fish.
Fish cannot source POSIX export files. Use config.local.fish for fish, and ~/.profile.local for bash/zsh login env.
pass and 1Password remain the preferred secret path. These extras are the machine-local escape hatch.
Verification Workflowsโ
Confirm effective shell + pathโ
echo "$SHELL"
fish --version
echo "$PATH"
Confirm key runtime wiringโ
echo "$SSH_AUTH_SOCK"
Confirm API key loading behaviorโ
echo "${GEMINI_API_KEY:+set}"
echo "${OPENROUTER_API_KEY:+set}"
Ignore Globs (fd / ripgrep / fzf)โ
This setup keeps a shared ignore-globs file used by fd/fzf defaults:
In fish, it's wired via:
FD_DEFAULT_OPTSinhome/dot_config/fish/readonly_config.fish.tmpl
Fish Pluginsโ
Fish plugins are managed with Fisher:
- Plugin list:
home/dot_config/fish/readonly_fish_plugins - Hook:
home/.chezmoiscripts/run_onchange_after_04-update-fish-packages.fish.tmpl
Troubleshootingโ
command not foundfor,commands:- check
~/bininPATH - run
chezmoi applyagain
- check
- Missing API keys:
- verify
passis installed and unlocked - verify the expected secret paths exist in your password store
- verify
Making Fish Your Login Shellโ
The setup script installs fish and will attempt to set it as your main shell: