even more intelegently set EDITOR
This commit is contained in:
parent
18868475d8
commit
bda5105914
1 changed files with 8 additions and 6 deletions
|
@ -14,12 +14,14 @@ if [ -z "$PROFILE_LOADED" ] && [ -f ~/.profile ]; then
|
|||
fi
|
||||
|
||||
# Intelligently set $EDITOR
|
||||
if command -v nvim > /dev/null;then
|
||||
export EDITOR=nvim
|
||||
elif command -v vim > /dev/null;then
|
||||
export EDITOR=vim
|
||||
elif command -v vi > /dev/null;then
|
||||
export EDITOR=vi
|
||||
if [ "${EDITOR:-}" = "" ] || [ "${EDITOR##*/}" = "nano" ]; then
|
||||
if command -v nvim > /dev/null;then
|
||||
export EDITOR=nvim
|
||||
elif command -v vim > /dev/null;then
|
||||
export EDITOR=vim
|
||||
elif command -v vi > /dev/null;then
|
||||
export EDITOR=vi
|
||||
fi
|
||||
fi
|
||||
export SYSTEMD_EDITOR="$EDITOR"
|
||||
export VISUAL="$EDITOR"
|
||||
|
|
Loading…
Add table
Reference in a new issue