diff options
| author | Daniel Pinkston <bard@bardiel> | 2023-12-22 18:16:40 -0500 |
|---|---|---|
| committer | Daniel Pinkston <bard@bardiel> | 2023-12-22 18:16:40 -0500 |
| commit | 8fc15de4dde8af83260b0656f403a43554618a05 (patch) | |
| tree | dfa1fba96fca3a598e5ec493528b5ff2bac6bd1b | |
| parent | b038d13fa42a9b29b08a13d554a7a5f8b7987f65 (diff) | |
fix: eshell keybinds erroring
| -rw-r--r-- | bard-elisp/bard-eshell.el | 19 |
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)) |
