Better eshell toggling
This commit is contained in:
@@ -829,7 +829,7 @@
|
|||||||
;;; Eshell
|
;;; Eshell
|
||||||
;;;; Eshell
|
;;;; Eshell
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
:bind (("M-`" . eshell))
|
:bind (("M-`" . thoom/eshell-toggle))
|
||||||
:config
|
:config
|
||||||
(setq eshell-destroy-buffer-when-process-dies t
|
(setq eshell-destroy-buffer-when-process-dies t
|
||||||
eshell-scroll-to-bottom-on-input t
|
eshell-scroll-to-bottom-on-input t
|
||||||
@@ -838,6 +838,18 @@
|
|||||||
eshell-visual-commands '()
|
eshell-visual-commands '()
|
||||||
eshell-banner-message "")
|
eshell-banner-message "")
|
||||||
|
|
||||||
|
(defun thoom/eshell-toggle ()
|
||||||
|
"Toggle eshell based on context.
|
||||||
|
If in eshell, call `popper-toggle`.
|
||||||
|
If not in eshell but in a project, call `project-eshell`.
|
||||||
|
Otherwise, call `eshell`."
|
||||||
|
(interactive)
|
||||||
|
(if (derived-mode-p 'eshell-mode)
|
||||||
|
(popper-toggle)
|
||||||
|
(if (project-current)
|
||||||
|
(project-eshell)
|
||||||
|
(eshell))))
|
||||||
|
|
||||||
;; From https://karthinks.com/software/jumping-directories-in-eshell/
|
;; From https://karthinks.com/software/jumping-directories-in-eshell/
|
||||||
(defun eshell/j (&optional regexp)
|
(defun eshell/j (&optional regexp)
|
||||||
"Navigate to a previously visited directory in eshell, or to
|
"Navigate to a previously visited directory in eshell, or to
|
||||||
|
|||||||
Reference in New Issue
Block a user