How to set environment variable for just one command in fish shell

fishshell

In bash, I can do EDITOR=vim crontab -e. Can I get similar effect in Fish shell?

Best Answer

begin; set -lx EDITOR vim; crontab -e; end