Where Is the Fish Shell Config File?
Where fish keeps config.fish, functions and universal variables on Linux and macOS, and where history really lives.
Last updated
Fish keeps its main config at ~/.config/fish/config.fish on Linux and macOS, with autoloaded functions in functions/ and completions in completions/ beside it. Universal variables (the fish equivalent of exported settings) persist separately in ~/.local/share/fish/fish_variables.
The config file runs at every shell start, so keep it lean: heavy commands there slow each new terminal. One time setup belongs in functions or universal variables instead. Fish never reads ~/.bashrc or ~/.zshrc, so migrated aliases must be translated by hand.
Where Fish stores this, by platform
~/.config/fish/config.fish
Follows XDG on all platforms, no exceptions. Respects $XDG_CONFIG_HOME when set. Edit with any editor, then open a new shell to test: fish has no source step for functions.
~/.config/fish/config.fish
Same path as Linux. Homebrew installs change nothing about config placement. History sits at ~/.local/share/fish/fish_history regardless of this file.
Frequently asked questions
Why is there no history in my fish config folder?
It is not there. Fish history lives in ~/.local/share/fish/fish_history, a YAML-ish file the shell manages itself. The config directory holds behavior (config.fish, functions, completions), never command history.
How do I add a function to fish?
Drop a file with a function definition into ~/.config/fish/functions/ (one function per file, matching names). Fish autoloads it on first use: no sourcing, no reload step, which is the part bash converts find magical.
Notice an outdated path? Let us know.