From 29ae7f935fe055aa8734864e9e361adc4895b6dd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 6 Jul 2018 15:33:25 +0200 Subject: [PATCH] Add eshell/mkdir-and-cd command I'd recommend aliasing this to mkdircd or take. --- modules/emacs/eshell/autoload/commands.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/emacs/eshell/autoload/commands.el b/modules/emacs/eshell/autoload/commands.el index 021764857..c1124c4cb 100644 --- a/modules/emacs/eshell/autoload/commands.el +++ b/modules/emacs/eshell/autoload/commands.el @@ -12,3 +12,9 @@ "Quit the current eshell buffer and close the window it's in." (setq-local +eshell-kill-window-on-exit t) (throw 'eshell-terminal t)) + +;;;###autoload +(defun eshell/mkdir-and-cd (dir) + "Create a directory then cd into it." + (make-directory dir t) + (eshell/cd dir))