sh: Ensure environment editor is available

When setting the environment variable EDITOR in the shell, ensure that
the editor being set is actually available: It first tries nvim, then
falls back to micro, then nano (one of which really every distribution
should have).
This commit is contained in:
Marty Oehme 2022-12-20 23:03:35 +01:00
parent 5fce112927
commit 2e6c1026fb
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9

View file

@ -20,7 +20,17 @@ export LIBRARYROOT="${LIBRARYROOT:-$HOME/documents/library}"
export BIBFILE="${BIBFILE:-$LIBRARYROOT/academia/academia.bib}" export BIBFILE="${BIBFILE:-$LIBRARYROOT/academia/academia.bib}"
# these are my personal 'important' application settings # these are my personal 'important' application settings
if exist nvim; then
export EDITOR="nvim" export EDITOR="nvim"
elif exist vim; then
export EDITOR="vim"
elif exist vi; then
export EDITOR="vi"
elif exist micro; then
export EDITOR="micro"
else
export EDITOR="nano"
fi
export BROWSER="qutebrowser" export BROWSER="qutebrowser"
export TERMINAL="wezterm" export TERMINAL="wezterm"
export PAGER="less" export PAGER="less"