summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)