mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add: tools/eshell: C-d now quits or deletes depending on state
this is the default behavior of bash, zsh et al.
This commit is contained in:
@ -35,6 +35,13 @@ module to be loaded."
|
|||||||
(+eshell/run))
|
(+eshell/run))
|
||||||
(doom/workspace-display))
|
(doom/workspace-display))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +eshell/quit-or-delete-char (arg)
|
||||||
|
(interactive "p")
|
||||||
|
(if (and (eolp) (looking-back eshell-prompt-regexp))
|
||||||
|
(eshell-life-is-too-much)
|
||||||
|
(delete-forward-char arg)))
|
||||||
|
|
||||||
(defun +eshell--outside-prompt-p ()
|
(defun +eshell--outside-prompt-p ()
|
||||||
(< (point) eshell-last-output-end))
|
(< (point) eshell-last-output-end))
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ redefines its keys every time `eshell-mode' is enabled."
|
|||||||
:i "C-u" #'eshell-kill-input
|
:i "C-u" #'eshell-kill-input
|
||||||
:i "SPC" #'self-insert-command
|
:i "SPC" #'self-insert-command
|
||||||
:i "C-a" #'eshell-bol
|
:i "C-a" #'eshell-bol
|
||||||
|
:i "C-d" #'+eshell/quit-or-delete-char
|
||||||
:m "<return>" #'+eshell/evil-append
|
:m "<return>" #'+eshell/evil-append
|
||||||
:n [remap evil-window-split] #'+eshell/split
|
:n [remap evil-window-split] #'+eshell/split
|
||||||
:n [remap evil-window-vsplit] #'+eshell/vsplit
|
:n [remap evil-window-vsplit] #'+eshell/vsplit
|
||||||
|
Reference in New Issue
Block a user