[1] http://serverfault.com/questions/164305/how-can-i-set-enviro...
[1] http://serverfault.com/questions/164305/how-can-i-set-enviro...
Also, why are you changing your EDITOR on a one-off basis, that shit should be permanent.
BTW, My point is not specific the EDITOR variable.
https://github.com/fish-shell/fish-shell/issues/587
I use Rails with rbenv, a common package which adds shell commands to control which version of Ruby is used. There is a fish port of it, so when you run the very common command "rake" it invokes a fish function which sets up the right environment. And when you do run rake, you often need to set environment variables to set one-time options for the procedure you're invoking.
Now the trap is set for the would-be fish user. Because you're actually using the fish shell to customize a command, you can't just punt to env with "env VERSION=20130411222645 rake db:migrate:down" because you actually want to run the fish function, not an executable.
So for now, I'm setting environment variables at the command line and unsetting them afterwards. It's really getting old, especially because it loses context in my command history. I think I'll probably ditch fish if I can't find a workaround for this, so any suggestions are appreciated.
From the current docs:
A universal variable is a variable whose value is shared across all instances of fish, now and in the future - even after a reboot. You can make a variable universal with set -U:
> set -U EDITOR vim
Now in another shell:
> echo $EDITOR vim
I am not asking for a way to make a variable universal, I am looking for a way to specify variable per command.