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/
.
Since fish version 3.0.0 the file lives in the more portable location
~/.config/fish/fish_variables
– Joey 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