From b52badd958bbebd916c9d6aa8b1a91afb6ed54b6 Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 8 Aug 2017 21:10:21 +0000 Subject: [PATCH] =?UTF-8?q?oh=20wait,=20actually=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • besides the previously-set $EDITOR take [jupp jstar mcedit ed vi] as sorted list, first one found wins • set -eu safe, and in the lksh part --- dot.mkshrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dot.mkshrc b/dot.mkshrc index 05e37c6..4a3dfea 100644 --- a/dot.mkshrc +++ b/dot.mkshrc @@ -1,5 +1,5 @@ # $Id$ -# $MirOS: src/bin/mksh/dot.mkshrc,v 1.120 2017/08/08 20:52:11 tg Exp $ +# $MirOS: src/bin/mksh/dot.mkshrc,v 1.121 2017/08/08 21:10:21 tg Exp $ #- # Copyright (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013, 2014, 2015, 2016, 2017 @@ -56,6 +56,13 @@ smores() ( done ) +# customise your favourite editor here; the first one found is used +for EDITOR in "${EDITOR:-}" jupp jstar mcedit ed vi; do + EDITOR=$(\\builtin whence -p "$EDITOR") || EDITOR= + [[ -n $EDITOR && -x $EDITOR ]] && break + EDITOR= +done + \\builtin alias ls=ls l='ls -F' la='l -a' ll='l -l' lo='l -alo' \: "${HOSTNAME:=$(\\builtin ulimit -c 0; \\builtin print -r -- $(hostname \ 2>/dev/null))}${EDITOR:=/bin/ed}${TERM:=vt100}${USER:=$(\\builtin ulimit \ @@ -617,7 +624,6 @@ done #\\builtin export LANG=C LC_CTYPE=$p LC_MEASUREMENT=$p LC_MESSAGES=$p LC_PAPER=$p #\\builtin set -U -p=$(\\builtin whence -p jupp) && EDITOR=$p \\builtin unset p \: place customisations above this line