diff options
| -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)) |
