From d88a036686497275931ea72626756e3f5414d7de Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 19 Sep 2024 10:44:56 +0200 Subject: e: Fix vi call and introduce nano MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vi branch was calling vim anyways, which is not what we want in restricted environments. Moreover, I have also added nano. It would be extremely rare for GNU nano to be there and not vi, but let's exhaust any possibility before bailing out. Signed-off-by: Miquel Sabaté Solà --- bin/e | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bin/e') diff --git a/bin/e b/bin/e index 32b05a0..db534fc 100755 --- a/bin/e +++ b/bin/e @@ -15,20 +15,23 @@ # along with this program. If not, see . # The *default editor*, which is meant to be installed globally. It attempts to -# write an editor with this preference: +# execute an editor with this preference: # 1. GNU Emacs in client mode. # 2. Vim -> Vi. # 3. Standalone GNU Emacs. -# 4. Outta luck: print an error message. +# 4. GNU nano +# 5. Outta luck: print an error message. if [ -x "$(command -v emacsclient)" ]; then exec emacsclient -a "" -nw "$@" -c elif [ -x "$(command -v vim)" ]; then exec vim "$@" elif [ -x "$(command -v vi)" ]; then - exec vim "$@" + exec vi "$@" elif [ -x "$(command -v emacs)" ]; then exec emacs --quick "$@" +elif [ -x "$(command -v nano)" ]; then + exec nano "$@" else echo "No suitable editor found!" exit 1 -- cgit v1.2.3