How can I set environment variables in fish?

Viewed 12464

I'm new to the fish shell, and just trying to set my $EDITOR variable so that's it's persistent across sessions and reboots. Here's what I've tried so far:

  1. Running set -gx EDITOR vim from the command line.
  2. Running set -Ux EDITOR vim from the command line.
  3. Running those commands, prefixed by set -e EDITOR to unset any previous value.
  4. Adding the above commands to my ~/.config/fish/config.fish file (it complains set: Warning: universal scope selected, but a global variable “EDITOR” exists.)
  5. Uninstalling oh-my-fish and removing all fish configs to start from scratch.

No matter what I do, the EDITOR variable always ends up being /usr/bin/nano whenever I open a new terminal, start a new session, or reboot. What's even more strange is that in ~/.config/fish/fishd.my-hostname, I see SET_EXPORT EDITOR vim, and nothing about nano. Is this some kind of fish default? If so, how can I set this correctly?

Edit: I'm running Fish 2.6.0 on Antergos Linux.

1 Answers
Related