aboutsummaryrefslogtreecommitdiff
path: root/bard-elisp/bard-eshell.el
diff options
context:
space:
mode:
authorDaniel Pinkston <bard@bardiel>2023-12-22 18:16:40 -0500
committerDaniel Pinkston <bard@bardiel>2023-12-22 18:16:40 -0500
commit8fc15de4dde8af83260b0656f403a43554618a05 (patch)
treedfa1fba96fca3a598e5ec493528b5ff2bac6bd1b /bard-elisp/bard-eshell.el
parentb038d13fa42a9b29b08a13d554a7a5f8b7987f65 (diff)
fix: eshell keybinds erroring
Diffstat (limited to 'bard-elisp/bard-eshell.el')
-rw-r--r--bard-elisp/bard-eshell.el19
1 files changed, 10 insertions, 9 deletions
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))