My ~/.config/fish/config.fish
is getting gigantic.
What is the idiomatic way to write another file and "source" it from inside this file so my main config isn't so huge?
Can I make like a ~/.config/fish/config-work.fish
and add source ~/.config/fish/config-work.fish
into my main config?
The configuration file runs at every login and is located at ~/. config/fish/config. fish . Adding commands or functions to the file will execute/define them when opening a terminal, similar to .
It does this by adding the components either to $fish_user_paths or directly to $PATH (if the --path switch is given). It is (by default) safe to use fish_add_path in config. fish, or it can be used once, interactively, and the paths will stay in future because of universal variables.
Prompt Tab The "prompt" tab displays the contents of the current fish shell prompt. It allows selection from 17 predefined prompts. To change the prompt, select one and press "Prompt Set!".
bashrc to conform to the subset of code that is valid in both bash and fish . Yes, fish is not bash-compatible, so reading . bashrc will typically not work.
Since version 2.3.0, fish automatically reads ~/.config/fish/conf.d/*.fish on startup, so you can also just use those.
Or you can manually source
files.
One strategy I use is to segregate functionality based on what machine I'm using.
In my ~/.config/fish/config.fish I have:
set host_config ~/.config/fish/config.(hostname).fish
test -r $host_config; and source $host_config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With