Add script to invoke random editor
This commit is contained in:
parent
c2cba29bb1
commit
4d7fe9779f
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
editors=""
|
||||
|
||||
for editor in ed nex nvi vim; do
|
||||
if command -v "$editor" >/dev/null; then
|
||||
if test -z "$editors"; then
|
||||
editors="$editor"
|
||||
else
|
||||
editors="$editors\n$editor"
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
random_editor="$(echo "$editors" | shuf | head -n 1)"
|
||||
|
||||
$random_editor "$@"
|
Loading…
Reference in New Issue