diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index 105c1c672..412d69bdc 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -135,8 +135,6 @@ You should use `set-eshell-alias!' to change this.") :ni "C-j" #'eshell-next-matching-input-from-input :ni "C-k" #'eshell-previous-matching-input-from-input :ig "C-d" #'+eshell/quit-or-delete-char - "TAB" #'+eshell/pcomplete - [tab] #'+eshell/pcomplete "C-s" #'+eshell/search-history ;; Emacs bindings "C-e" #'end-of-line @@ -154,16 +152,7 @@ You should use `set-eshell-alias!' to change this.") [remap doom/backward-kill-to-bol-and-indent] #'eshell-kill-input [remap evil-delete-back-to-indentation] #'eshell-kill-input [remap evil-window-split] #'+eshell/split-below - [remap evil-window-vsplit] #'+eshell/split-right))) - (add-hook! 'eshell-mode-hook - (defun +eshell-init-company-h () - (when (featurep! :completion company) - (company-mode +1) - (setq-local company-idle-delay nil) - (setq-local company-backends '(company-pcomplete)) - (setq-local company-frontends (cons 'company-tng-frontend company-frontends)) - (when (bound-and-true-p evil-local-mode) - (evil-normalize-keymaps)))))) + [remap evil-window-vsplit] #'+eshell/split-right)))) (use-package! eshell-up @@ -182,3 +171,15 @@ You should use `set-eshell-alias!' to change this.") (use-package! esh-help :after eshell :config (setup-esh-help-eldoc)) + + +(use-package! fish-completion + :hook (eshell-mode . fish-completion-mode) + :init (setq fish-completion-fallback-on-bash-p t) + :config + ;; HACK Even with `fish-completion-fallback-on-bash-p' non-nil, fish must be + ;; installed for bash completion to work. How frustrating. This way we + ;; can at least get bash completion whether or not fish is present. + (defadvice! +eshell--fallback-to-bash-a (&rest _) + :before-while #'fish-completion--list-completions-with-desc + (executable-find "fish"))) diff --git a/modules/term/eshell/packages.el b/modules/term/eshell/packages.el index 6eb2b23a9..82a18ed14 100644 --- a/modules/term/eshell/packages.el +++ b/modules/term/eshell/packages.el @@ -5,3 +5,7 @@ (package! eshell-z :pin "337cb241e1") (package! shrink-path :pin "c14882c859") (package! esh-help :pin "417673ed18") + +(when (featurep! :completion company) + (package! fish-completion :pin "1038488181") + (package! bash-completion :pin "96ce14af96"))