[shell-common] Select an editor (resolves #1)

This commit is contained in:
2024-11-26 17:01:56 +00:00
parent 294b0f87e6
commit 30a2230f80

View File

@@ -7,13 +7,14 @@ export TZ=GB
export LANG=en_GB.UTF-8 export LANG=en_GB.UTF-8
# Make a sensible editor choice # Make a sensible editor choice
if [ -x /usr/bin/nano ]; then editor_preferences=(nano pico vim vi)
export EDITOR=nano for editor in "${editor_preferences[@]}"; do
export VISUAL=nano if [ -x "$(which $editor)" ]; then
else export EDITOR=$editor
export EDITOR=vi export VISUAL=$editor
export VISUAL=vi break
fi fi
done
# Go stuff # Go stuff
export GOPATH=$HOME/go/ export GOPATH=$HOME/go/