summaryrefslogtreecommitdiff
path: root/v-editor.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-06-21 21:44:46 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-06-21 21:44:46 -0400
commit896161c483ceef3ed16e2f19a5c05106bed04512 (patch)
tree8e79f92d7b3dfe09fa97f4ae5feb8331ad6fbb52 /v-editor.sh
I can't believe I didn't have this in git before.
Diffstat (limited to 'v-editor.sh')
-rw-r--r--v-editor.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/v-editor.sh b/v-editor.sh
new file mode 100644
index 0000000..ef6f0a1
--- /dev/null
+++ b/v-editor.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+(if [ -n "$DISPLAY" ]; then eval ${VISUAL:-$SELECTED_EDITOR} "$@"
+ else eval ${EDITOR:-$SELECTED_EDITOR} "$@"
+fi) || eval ${ALTERNATE_EDITOR:-false} "$@"
+
+