aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-18 11:09:47 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-18 11:09:47 +1200
commit00c3c1f3b1221e5dc2d57b53daef7eb1b0f09858 (patch)
treef9dc59e014ee712aa2fd84b08ce7710493c3e26e
parentf096d0e23c15efbe3baefd6029f9f56255e87f08 (diff)
downloaddotfiles-00c3c1f3b1221e5dc2d57b53daef7eb1b0f09858.tar.gz
dotfiles-00c3c1f3b1221e5dc2d57b53daef7eb1b0f09858.zip
Arrange EDITOR/VISUAL in a more typical way
-rwxr-xr-xbin/eds4
-rwxr-xr-xbin/td4
-rw-r--r--sh/profile.d/editor.sh7
-rw-r--r--sh/profile.d/visual.sh3
4 files changed, 10 insertions, 8 deletions
diff --git a/bin/eds b/bin/eds
index 1855fb34..2afd0a07 100755
--- a/bin/eds
+++ b/bin/eds
@@ -43,8 +43,8 @@ for file in "${files[@]}" ; do
creations[${#creations[@]}]=$file
done
-# Run the editor; if EDITOR isn't set, use vi(1)
-"${EDITOR:-vi}" "${opts[@]}" -- "${files[@]}"
+# Run the editor; if EDITOR isn't set, use ed(1)
+"${VISUAL:-"${EDITOR:-ed}"}" "${opts[@]}" -- "${files[@]}"
# Make any created scripts executable if they now appear to be files
for creation in "${creations[@]}" ; do
diff --git a/bin/td b/bin/td
index e6cbfd93..5088f572 100755
--- a/bin/td
+++ b/bin/td
@@ -21,8 +21,8 @@ isgr || git init || exit
# If the to-do file doesn't exist yet, create it
[ -e "$file" ] || touch -- "$file" || exit
-# Launch $VISUAL (or $EDITOR (or vi(1))) to edit the appropriate to-do file
-"${VISUAL:-"${EDITOR:-vi}"}" "$file"
+# Launch an appropriate editor to edit that file
+"${VISUAL:-"${EDITOR:-ed}"}" "$file"
# Add the file to the changeset
git add -- "$file"
diff --git a/sh/profile.d/editor.sh b/sh/profile.d/editor.sh
index 7ed9e262..ee0da70b 100644
--- a/sh/profile.d/editor.sh
+++ b/sh/profile.d/editor.sh
@@ -1,4 +1,3 @@
-# Set editor
-EDITOR=vi
-VISUAL=$EDITOR
-export EDITOR VISUAL
+# Set command-line editor
+EDITOR=ed
+export EDITOR
diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh
new file mode 100644
index 00000000..95eb1d5d
--- /dev/null
+++ b/sh/profile.d/visual.sh
@@ -0,0 +1,3 @@
+# Set visual editor
+VISUAL=vi
+export VISUAL