summaryrefslogtreecommitdiffstats
path: root/lisp/init-eshell.el
blob: 2706a306482200bfde9be9380d1ac54a42c5d29f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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-eshell' 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