diff --git a/dotfiles/lib/editor.sh b/dotfiles/lib/editor.sh new file mode 100755 index 00000000..fac0e444 --- /dev/null +++ b/dotfiles/lib/editor.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env zsh +[ -z "$*" ] && emacs || emacs_open "$@" diff --git a/dotfiles/lib/shellenv/emacs.sh b/dotfiles/lib/shellenv/emacs.sh index b6924a28..2f00a33d 100644 --- a/dotfiles/lib/shellenv/emacs.sh +++ b/dotfiles/lib/shellenv/emacs.sh @@ -77,7 +77,6 @@ function time_emacs { } # Make emacs the default editor. -export EDITOR="e() { zsh -c 'emacs_open '"'"$@"; return 0; }; e' +export EDITOR="$HOME/.lib/editor.sh" export VISUAL="$EDITOR" -# This is ugly as sin but I can't figure out how else to do it. -export GIT_EDITOR="zsh -c 'emacs_open '"'"$@"; return 0' +export GIT_EDITOR="$EDITOR"