summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2013-06-02 20:20:17 +0100
committerAlan Pearce2013-06-02 20:20:17 +0100
commit6ce4aa99a7ea9a7996b971e38c83a56e4bab82af (patch)
treee921c59a6d64d1f31320930db3666adae58c08fd
parent954a691139a1756af64e2db7091c6ea66cb92fe9 (diff)
downloaddotfiles-6ce4aa99a7ea9a7996b971e38c83a56e4bab82af.tar.lz
dotfiles-6ce4aa99a7ea9a7996b971e38c83a56e4bab82af.tar.zst
dotfiles-6ce4aa99a7ea9a7996b971e38c83a56e4bab82af.zip
Emacs: add function and keybinding for opening eshell in the current directory
-rw-r--r--emacs/init.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el
index e88c923..96d105e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -743,6 +743,13 @@ Also returns nil if pid is nil."
                             eshell-smart-space-goes-to-end t)
                       (eshell-smart-initialize)))))
 
+(defun eshell-goto-current-dir (&optional arg)
+  (interactive "P")
+  (let ((dir default-directory))
+    (eshell arg)
+    (eshell/cd dir)))
+(bind-key "C-c S" #'eshell-goto-current-dir)
+
 (use-package shell
   :defer t
   :config (define-key shell-mode-map