[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
# Make a sensible editor choice
if [ -x /usr/bin/nano ]; then
export EDITOR=nano
export VISUAL=nano
else
export EDITOR=vi
export VISUAL=vi
fi
editor_preferences=(nano pico vim vi)
for editor in "${editor_preferences[@]}"; do
if [ -x "$(which $editor)" ]; then
export EDITOR=$editor
export VISUAL=$editor
break
fi
done
# Go stuff
export GOPATH=$HOME/go/