Closed matthias-t closed 6 years ago
Here's a solution in bash
(from stackoverflow):
"${EDITOR:-vi}" ~/.workspace/NAME.toml
where vi
is a POSIX-guaranteed-to-be-present fallback in case $EDITOR
is unset.
In PowerShell that'd be just Actually, that behaves more like ~/.workspace/NAME.toml
.xdg-open
.
Since it's different for each shell, we should add a new recognized prefix to our shell wrappers, something like I chose to get the environment variable from Rust and then pass down a command to the shell function. There is no fallback, so if EDIT>
.$EDITOR
and $VISUAL
are unset it will show a descriptive error message.
This is the shortest solution I found for fish:
set editor $EDITOR vi; eval $editor[1] ~/.workspace/NAME.toml
Open the
toml
file for the workspace in the default editor