about summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2017-06-25T19·43-0400
committerWilliam Carroll <wpcarro@gmail.com>2017-06-25T19·44-0400
commit257246aed5ad0289a0ded084a03feedb0cbf0447 (patch)
tree511e9c1e44f4c01cdb77687227a0b85ac1a37419 /emacs
parentb91fdbd28fd71f1674ac57314a298ea03ae9ab82 (diff)
Updates ZSH_THEME and trims fat from config
Diffstat (limited to 'emacs')
-rwxr-xr-xemacs/index.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/emacs/index.sh b/emacs/index.sh
index e794c24ae942..d80372eba312 100755
--- a/emacs/index.sh
+++ b/emacs/index.sh
@@ -1,6 +1,15 @@
 #!/usr/bin/env zsh
 
 
+# Have zsh export variables for Emacs to track the cwd
+if [ -n "$INSIDE_EMACS" ]; then
+  chpwd() { print -P "\033AnSiTc %d" }
+  print -P "\033AnSiTu %n"
+  print -P "\033AnSiTc %d"
+fi
+
+
+# Custom emacs pager support
 if [ -n "$INSIDE_EMACS" ]; then
     export PAGER="create-shell-pager.sh"
 else
@@ -8,22 +17,25 @@ else
 fi
 
 
+# Edit commit messages, etc from ansi-term in emacs
 if [ -n "$INSIDE_EMACS" ]; then
     export EDITOR="edit-file-in-emacs.sh"
 else
-    export EDITOR="command nvim"
+    export EDITOR="command vim"
 fi
 
 
+# Calls to vim from within ansi-term trigger emacs find-file
 vim () {
     if [ -n "$INSIDE_EMACS" ]; then
         emacsclient -e "(find-file-other-window \"$1\")"
     else
-        nvim "$1"
+        command vim "$1"
     fi
 }
 
 
+# Calls to man from within ansi-term trigger emacs man
 man () {
     if [ -n "$INSIDE_EMACS" ]; then
         emacsclient -e  "(man \"$1\")"