diff --git a/modules/term/eshell/README.org b/modules/term/eshell/README.org new file mode 100644 index 000000000..8d9f63adf --- /dev/null +++ b/modules/term/eshell/README.org @@ -0,0 +1,45 @@ +#+TITLE: term/eshell +#+DATE: April 17, 2020 +#+SINCE: {replace with next tagged release version} +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: + +* Description +This module provides additional features for the built-in [[https://www.gnu.org/software/emacs/manual/html_mono/eshell.html][Emacs Shell]] + +The Emacs Shell or =eshell= is a shell-like command interpreter implemented in +Emacs Lisp. It is an alternative to traditional shells such as =bash=, =zsh=, +=fish=, etc. that is built into Emacs and entirely cross-platform. + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags +This module provides no flags, but does gain auto-completion if =:completion +company= is enabled. + +** Plugins ++ [[https://github.com/peterwvj/eshell-up][eshell-up]] ++ [[https://github.com/xuchunyang/eshell-z][eshell-z]] ++ [[https://github.com/tom-tan/esh-help][esh-help]] ++ [[https://gitlab.com/bennya/shrink-path.el][shrink-path]] ++ [[https://github.com/xuchunyang/eshell-did-you-mean][eshell-did-you-mean]] ++ =:completion company= + + [[https://gitlab.com/ambrevar/emacs-fish-completion][fish-completion]] + + [[https://github.com/szermatt/emacs-bash-completion][bash-completion]] + +* Prerequisites +This module has no prerequisites. + +* Features ++ Command completion with Company ++ =fish=-style prompt with Git integration ++ [[https://github.com/rupa/z][=z=]]-like directory jumping ++ Command-not-found recommendations + +* TODO Configuration +# How to configure this module, including common problems and how to address them. + +* TODO Troubleshooting +# Common issues and their solution, or places to look for help. diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index 412d69bdc..0b923faff 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -82,6 +82,10 @@ You should use `set-eshell-alias!' to change this.") ;; Enable autopairing in eshell (add-hook 'eshell-mode-hook #'smartparens-mode) + ;; Comapny completion integration + (when (featurep! :completion company) + (add-hook 'eshell-mode-hook #'company-mode)) + ;; Persp-mode/workspaces integration (when (featurep! :ui workspaces) (add-hook 'persp-activated-functions #'+eshell-switch-workspace-fn) @@ -152,7 +156,13 @@ 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)))) + [remap evil-window-vsplit] #'+eshell/split-right + + ;; Local-leader keybindings + (:localleader + "b" #'eshell-insert-buffer-name + "e" #'eshell-insert-envvar + "s" #'+eshell/search-history))))) (use-package! eshell-up @@ -183,3 +193,7 @@ You should use `set-eshell-alias!' to change this.") (defadvice! +eshell--fallback-to-bash-a (&rest _) :before-while #'fish-completion--list-completions-with-desc (executable-find "fish"))) + +;; Active eshell-did-you-mean using its setup function which provides +;; its own hooks. +(eshell-did-you-mean-setup) diff --git a/modules/term/eshell/packages.el b/modules/term/eshell/packages.el index 82a18ed14..0d287a889 100644 --- a/modules/term/eshell/packages.el +++ b/modules/term/eshell/packages.el @@ -5,6 +5,7 @@ (package! eshell-z :pin "337cb241e1") (package! shrink-path :pin "c14882c859") (package! esh-help :pin "417673ed18") +(package! eshell-did-you-mean :pin "7cb6ef") (when (featurep! :completion company) (package! fish-completion :pin "1038488181")