aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-01-04 10:18:06 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-01-04 10:19:58 +1300
commit97a0d713317036d773df6476f8ae47a1e423276f (patch)
tree801397ab604b39e27156e078ed7474df5d2bd4a7 /sh
parentUse :lhelpgrep for help search shortcut (diff)
downloaddotfiles-97a0d713317036d773df6476f8ae47a1e423276f.tar.gz
dotfiles-97a0d713317036d773df6476f8ae47a1e423276f.zip
Further attempts at sane Emacs VISUAL setting
Diffstat (limited to 'sh')
-rw-r--r--sh/profile.d/visual.sh26
1 files changed, 5 insertions, 21 deletions
diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh
index f79158b8..d5280abd 100644
--- a/sh/profile.d/visual.sh
+++ b/sh/profile.d/visual.sh
@@ -1,24 +1,8 @@
-# If an Emacs is installed, and ~/.emacs exists, use emacs as the visual
-# editor; otherwise, use the system's vi
-if command -v emacs >/dev/null 2>&1 &&
- [ -f "$HOME"/.emacs ] ; then
-
- # Use or start a GNU Emacs client, if possible
- if command -v pgrep >/dev/null 2>&1 &&
- pgrep -fxu "$USER" 'emacs --daemon' >/dev/null ||
- emacs --daemon 2>/dev/null ; then
- VISUAL=emacsclient
-
- # If no GNU Emacs daemon is available, just create a new instance every
- # time
- else
- VISUAL=emacs
- fi
-
-# If an Emacs isn't installed, just use good old vi
+# If my Emacs wrapper is installed, use emacs as the visual editor; otherwise,
+# use the system's vi
+if command -v emacsm >/dev/null 2>&1 ; then
+ VISUAL='emacsm'
else
- VISUAL=vi
+ VISUAL='vi'
fi
-
-# Export final editor decision
export VISUAL