diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-01-01 01:06:17 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-01-01 01:11:03 +1300 |
commit | 36f7528137c18a16c842525f69ff0a3d445d8e46 (patch) | |
tree | 6c25fb704ff6ef485c85ee27160552201cc4f1ba /sh | |
parent | Trim some trailing whitespace (diff) | |
download | dotfiles-36f7528137c18a16c842525f69ff0a3d445d8e46.tar.gz dotfiles-36f7528137c18a16c842525f69ff0a3d445d8e46.zip |
Switch to using GNU Emacs on development machines
> Andromeda, by Perseus sav'd and wed,
> Hanker'd each day to see the Gorgon's head:
> Till o'er a fount he held it, bade her lean,
> And mirror'd in the wave was safely seen
> That death she liv'd by.
> Let not thine eyes know
> Any forbidden thing itself, although
> It once should save as well as kill: but be
> Its shadow upon life enough for thee.
>
> --Dante Gabriel Rossetti
Diffstat (limited to 'sh')
-rw-r--r-- | sh/profile.d/visual.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh index 119d81c7..94aee963 100644 --- a/sh/profile.d/visual.sh +++ b/sh/profile.d/visual.sh @@ -1,3 +1,9 @@ -# Use first found implementation of vi(1) -VISUAL='vi' +# If 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 + VISUAL=emacs +else + VISUAL=vi +fi export VISUAL |