From 9b44d35171bb4f6a0811802b183541fecd273af1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 20 Nov 2014 22:14:12 -0800 Subject: [PATCH] Properly set EDITOR for zsh inline editing. GIT_EDITOR actually needs to be different becaseu of the way that it works. --- dotfiles/lib/shellenv.sh | 1 + dotfiles/lib/shellrc/emacs.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dotfiles/lib/shellenv.sh b/dotfiles/lib/shellenv.sh index 4b7097c8..32a9353f 100644 --- a/dotfiles/lib/shellenv.sh +++ b/dotfiles/lib/shellenv.sh @@ -1,4 +1,5 @@ source ~/.lib/shellrc/functions.sh +source ~/.lib/shellrc/emacs.sh function add_to_front_of_path { export PATH=$@:$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||") } diff --git a/dotfiles/lib/shellrc/emacs.sh b/dotfiles/lib/shellrc/emacs.sh index 5a5c5048..c06c1261 100644 --- a/dotfiles/lib/shellrc/emacs.sh +++ b/dotfiles/lib/shellrc/emacs.sh @@ -48,7 +48,7 @@ function existing_emacs { } function emacs_make_frame_if_none_exists { - emacsclient -e '(make-frame-if-none-exists-and-focus)' --server-file=$1 + emacsclient -e '(make-frame-if-none-exists-and-focus)' --server-file=$1 > /dev/null focus_emacs } @@ -71,5 +71,7 @@ function emacs_open { } # Make emacs the default editor. -export EDITOR="zsh -c 'source ~/.zshrc && emacs_open '"'"$@"' +export EDITOR='emacs_open' export VISUAL="$EDITOR" +# This is ugly as sin but I can't figure out how else to do it. +export GIT_EDITOR="zsh -c 'source ~/.zshrc && emacs_open '"'"$@"'