From dcdce9e2552c61aec73e7e2835c4df585e234adb Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Wed, 16 Oct 2024 16:49:57 +0100 Subject: Adjust eshell bindings I've now made the hook a function, so reloading this snippet will not add useless extra functions to the hook. Also a eshell/goto binding. --- Emacs/.config/emacs/config.org | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 57c845e..93d2f0a 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -1938,28 +1938,28 @@ them. (interactive) (eshell/clear-scrollback) (eshell-send-input)) + (add-hook 'eshell-mode-hook - (proc - (interactive) - ;; (nmap - ;; :keymaps 'eshell-mode-map - ;; "0" #'eshell-bol - ;; "I" (proc (interactive) - ;; (eshell-bol) - ;; (evil-insert 0))) - (general-def - :states '(normal insert visual) - :keymaps 'eshell-mode-map - "M-j" #'eshell-next-prompt - "M-k" #'eshell-previous-prompt - "C-j" #'eshell-next-matching-input-from-input - "C-k" #'eshell-previous-matching-input-from-input - "M-c" #'+eshell/good-clear) - (local-leader - :keymaps 'eshell-mode-map - "c" #'+eshell/good-clear - "k" #'eshell-kill-process)))) + (defun +eshell/--setup-keymap nil + (interactive) + (general-def + :states '(normal insert visual) + :keymaps 'eshell-mode-map + "M-j" #'eshell-next-prompt + "M-k" #'eshell-previous-prompt + "C-j" #'eshell-next-matching-input-from-input + "C-k" #'eshell-previous-matching-input-from-input) + + (local-leader + :keymaps 'eshell-mode-map + "g" (proc (interactive) + (let ((buffer (current-buffer))) + (eshell/goto) + (with-current-buffer buffer + (eshell-send-input)))) + "c" #'+eshell/good-clear + "k" #'eshell-kill-process)))) #+end_src *** EShell prompt Here I use my external library -- cgit v1.2.3-13-gbd6f