I want to start a particular fish instance with a specific config.fish.

Something along the lines of the Bash --rcfile option.

I'm aware of the XDG_CONFIG_HOME variable. But I just want to switch the config for fish. Not for other programs using XDG I would run from that fish instance.

  • here's a hack: temporarily swap out the config file: cd ~/.config/fish; mv config.fish config.fish~; ln my.other.config.fish config.fish; fish &; mv config.fish~ config.fish; fg – glenn jackman Feb 20 at 14:28

Apparently, the --init-command=COMMANDS startup option was added in fish 2.7

Something along the line of that should do the trick:

 fish --init-command='source /path/to/alternate/fish.config'

But I'm unable to test since we are using here fish 2.4.0. Maybe is there a workaround?

  • 1
    Note that --init-command does not suppress reading the default config file. – Kurtis Rader Feb 20 at 16:12

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.