From 8c56a91570ec8fe9839378851878f578968e5dfb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 15 Mar 2023 21:50:26 +0100 Subject: emacs: close eshell buffer and window when running `exit` --- user/emacs/init.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'user/emacs') diff --git a/user/emacs/init.el b/user/emacs/init.el index 702a60d6..5def6aee 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -697,10 +697,12 @@ _p_rev _u_pper _=_: upper/lower _r_esolve :init (progn (with-eval-after-load 'evil-ex (evil-ex-define-cmd "esh[ell]" #'eshell))) - :config (setq eshell-prompt-function (lambda () - (concat (eshell/pwd) "\n$ ")) - eshell-prompt-regexp "^[$][[:blank:]]" - eshell-cmpl-cycle-completions nil)) + :config (progn + (setq eshell-prompt-function (lambda () + (concat (eshell/pwd) "\n$ ")) + eshell-prompt-regexp "^[$][[:blank:]]" + eshell-cmpl-cycle-completions nil) + (add-hook 'eshell-exit-hook #'evil-window-delete))) (use-package eshell-toggle :after projectile -- cgit 1.4.1