From 8fc15de4dde8af83260b0656f403a43554618a05 Mon Sep 17 00:00:00 2001 From: Daniel Pinkston Date: Fri, 22 Dec 2023 18:16:40 -0500 Subject: fix: eshell keybinds erroring --- bard-elisp/bard-eshell.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'bard-elisp') diff --git a/bard-elisp/bard-eshell.el b/bard-elisp/bard-eshell.el index dd255c8..fb0770f 100644 --- a/bard-elisp/bard-eshell.el +++ b/bard-elisp/bard-eshell.el @@ -1,11 +1,12 @@ (require 'cl-lib) +(require 'eshell) (defun bard/eshell-complete-recent-dir (&optional args) - "Switch to a recent `eshell` directory using completion" + "Switch to a recent `eshell` directory using completion." (interactive "P") (let* ((dirs (ring-elements eshell-last-dir-ring)) (dir (vertico--exhibit () - (completing-read "Switch to recent dir: " dirs nil t)))) + (completing-read "Switch to recent dir: " dirs nil t)))) (insert-dir) (eshell-send-input) (when arg @@ -45,10 +46,10 @@ ((not in-eshellp) (switch-to-buffer (car buffers))) (t (select-or-create (completing-read "Select Shell:" (cons "New eshell" names))))))) -(define-key eshell-mode-map (kbd "C-c f") #'bard/eshell-find-file-at-point) -;; (define-key eshell-mode-map (kbd "C-c h") #'bard/eshell-narrow-ouput-highlight-regexp) -(define-key eshell-mode-map (kbd "C-c d") #'bard/eshell-complete-recent-dir) -(define-key eshell-mode-map (kbd "M-k") #'eshell-kill-input) -(global-set-key (kbd "C-z") nil) - -(define-key global-map (kbd "C-z e") #'eshell-switcher) +(with-eval-after-load "esh-mode" + (define-key eshell-mode-map (kbd "C-c f") #'bard/eshell-find-file-at-point) + (define-key eshell-mode-map (kbd "C-c h") #'bard/eshell-narrow-ouput-highlight-regexp) + (define-key eshell-mode-map (kbd "C-c d") #'bard/eshell-complete-recent-dir) + (define-key eshell-mode-map (kbd "M-k") #'eshell-kill-input) + (global-set-key (kbd "C-z") nil) + (define-key global-map (kbd "C-z e") #'eshell-switcher)) -- cgit v1.2.3