summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-02-01 19:10:21 -0500
committerKyle Meyer <kyle@kyleam.com>2015-02-02 22:47:08 -0500
commit35bf88f0a92e2be843b62f3811c8f34d0a655813 (patch)
treef8c766e76165b3df4fbe3282f922b0056e9f1f28
parentb91d5edb04a6649de785a628863bf730bb9df0fb (diff)
downloademacs.d-35bf88f0a92e2be843b62f3811c8f34d0a655813.tar.gz
Add command zsh-toggle-ansi-term-home
-rw-r--r--lisp/init-external.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/init-external.el b/lisp/init-external.el
index 392cae9..1cf5ddc 100644
--- a/lisp/init-external.el
+++ b/lisp/init-external.el
@@ -54,6 +54,12 @@ With any other non-nil value, prompt for a directory."
(t
(ansi-term "/bin/zsh" name)))))
+(defun km/zsh-toggle-ansi-term-home ()
+ (interactive)
+ (if (string= "*zsh: ~/*" (buffer-name))
+ (bury-buffer)
+ (km/zsh-ansi-term "~/")))
+
(defun km/zsh-ansi-term-other-window (&optional directory)
(interactive (km/zsh-ansi-term--args))
(pop-to-buffer (save-window-excursion (km/zsh-ansi-term directory))))
@@ -89,6 +95,8 @@ BUFFER defaults to current buffer."
(define-key km/external-map "s" 'shell-command)
(define-key km/external-map "S" 'shell)
+(key-chord-define-global "kz" 'km/zsh-toggle-ansi-term-home)
+
;; This overrides binding for `add-change-log-entry-other-window'.
(define-key ctl-x-4-map "a" 'km/zsh-ansi-term-other-window)