clarkgrubb / hyperpolyglot

hyperpolyglot.org
Other
473 stars 94 forks source link

fish: simple command with environment variable #41

Open GReagle opened 8 years ago

GReagle commented 8 years ago

Can you create another entry in the first table "Grammar" for fish, row "simple command with environment variable"? env EDITOR=vi git commit is indeed correct, but there is another way that will work with fish functions as well, whereas env expects a real command. The other option is:

begin; set -lx EDITOR vi; git commit; end

This is actually the equivalent in fish using fish grammar and syntax. The env command method works for all shells. See https://github.com/fish-shell/fish-shell/issues/2415 for a discussion.