Personalization
Sensitive credentials and machine-specific settings are kept out of version
control in a private directory. The path defaults to
~/.config/.user-dots/fish/ but can be overridden:
set -U __fish_user_dots_path /path/to/your/dots/fishOr use the interactive TUI — run config-settings and navigate to the
“Dots Path” row (last row). Press Enter to type a new path, or ← / h to
reset to the default.
config.fish sources local.fish from that directory on every interactive
session. local.fish is responsible for sourcing its own secrets.fish:
Directory$__fish_user_dots_path/
- secrets.fish API keys, tokens, passwords, personal identifiers
- local.fish Machine-specific paths, env vars, and sourcing secrets
fish_variables (auto-managed by fish) is excluded from this repo via
.gitignore. Do not commit it.
secrets.fish
Section titled “secrets.fish”Store anything you would not commit to a public repo: API keys, auth tokens, passwords, and personal identifiers.
set -gx MY_NAME "Your Name"set -gx MY_EMAIL "you@example.com"set -gx GPG_RECIPIENT "you@example.com"set -gx GITHUB_TOKEN ghp_yourTokenHereset -gx OPENAI_API_KEY sk-proj-yourKeyHereset -gx GITEA_TOKEN yourGiteaTokenHereset -gx GITEA_CHOSEN_LOGIN your.gitea.instanceset -gx KOPIA_PASSWORD yourKopiaPasswordlocal.fish
Section titled “local.fish”Store paths and variables specific to one machine — things that would be wrong on any other system.
set -gx CDPATH . /home/youruser/projects /home/youruserset -gx GITIGNORE_BOILERPLATE ~/.config/git/gitignore_boilerplateabbr -a sshr 'ssh you@your-server.local'abbr -a sshw 'ssh you@work-server.example.com'abbr -a dcr 'docker context use my-remote-server'abbr -a dcw 'docker context use work-server'local.fish is sourced at the end of config.fish with an existence check so
the public config works cleanly on any machine without the private repo.
local.fish in turn sources secrets.fish when it exists.
functions/
Section titled “functions/”Functions in $__fish_user_dots_path/functions/ autoload in every shell
and take precedence over this config’s functions of the same name. The
directory is put first on $fish_function_path at startup if it exists;
this is not behind any component guard, because the directory only exists
if you created it.
fish-template writes the functions it generates there. See
fish-template help.
completions/
Section titled “completions/”Completions in $__fish_user_dots_path/completions/ autoload the same way
as those in ~/.config/fish/completions/: fish loads <command>.fish the
first time you press Tab on that command. Use it for completions that only
make sense on one machine, such as ones generated by a locally installed
tool:
mkdir -p (__fish_user_dots_dir)/completionsregister-python-argcomplete --shell fish pipx >(__fish_user_dots_dir)/completions/pipx.fishThe directory is put first on $fish_complete_path at startup if it
exists, so start a new shell after creating it. Like functions/, it is
not behind any component guard. When __fish_user_dots_path is unset, the
default ~/.config/.user-dots/fish/completions/ is used.
fish loads only the first <command>.fish it finds, so a file here
replaces this config’s or the system’s completion for that command rather
than adding to it. To extend an existing completion instead, load the
original at the top of your file with
__fish_source_upstream_completion <command> (status filename), or put the
extra complete lines in local.fish.