26

set -xU CFLAGS "-g" will set a universal variable that will persist across sessions. So this variable value must be store in the filesystem somewhere. Where exactly?

I would like to put this file under version control (git) in my ~/dotfiles/.

RubenLaguna
  • 21,435
  • 13
  • 113
  • 151

1 Answers1

28

Since fish version 3.0.0 the file lives in the more portable location ~/.config/fish/fish_variablesJoey Sabey (Edited to be absolute rather than relative path)


in ~/.config/fish/fishd.(hostname)

Since it's host-specific, I'd recommend you put settings you want to share in ~/.config/fish/config.fish

Joey Sabey
  • 1,058
  • 7
  • 9
glenn jackman
  • 238,783
  • 38
  • 220
  • 352
  • 7
    fish 2.0 replaces the hostname with the MAC address, so that you don't lose variables when you change hostnames. The recommendation to use config.fish is right on. – ridiculous_fish Nov 20 '13 at 23:54
  • When made `fishd.MAC` into a symlink to track it in git, it was replaced with a file whenever I `set -U` a new variable. So that may not work for this specific purpose. – hfs Oct 19 '16 at 19:31
  • This should get you the contents of the file: `cat ~/.config/fish/fishd.(ifconfig en0 | awk '/ether/{print $2}' | tr -d ':')` – mattmc3 Nov 09 '18 at 21:38
  • 4
    Since fish version 3.0.0 the file lives in the more portable location `.config/fish/fish_variables` – Joey Sabey Sep 19 '19 at 15:13
  • Thanks @JoeySabey. – glenn jackman Sep 19 '19 at 22:50