From 70c829959c1f6e8a73fa4bb4bda73f373cb9f24e Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Wed, 6 Mar 2024 12:45:32 +0100 Subject: eshell: C-c e opens eshell in another window --- lisp/init-eshell.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lisp/init-eshell.el (limited to 'lisp/init-eshell.el') diff --git a/lisp/init-eshell.el b/lisp/init-eshell.el new file mode 100644 index 0000000..952989a --- /dev/null +++ b/lisp/init-eshell.el @@ -0,0 +1,23 @@ +;;; init-eshell.el --- configure eshell -*- lexical-binding:t -*- +;;; Commentary: +;;; Code: + +(defun mpolden/eshell-other-window () + "Create a new Eshell buffer in another window. + +If `default-directory' is determined to be a project by +`project-current', the Eshell buffer will be created with +`project-shell' instead of `eshell'." + (interactive) + (let ((buf (if (project-current) + (project-eshell) + (eshell)))) + (switch-to-buffer (other-buffer buf)) + (switch-to-buffer-other-window buf))) + +(use-package eshell + :bind (("C-c e" . mpolden/eshell-other-window))) + +(provide 'init-eshell) + +;;; init-eshell.el ends here -- cgit v1.2.3