term/eshell: improve completion
This commit is contained in:
parent
0344d6719c
commit
9b95a18eb8
2 changed files with 19 additions and 2 deletions
|
@ -45,6 +45,7 @@ You should use `set-eshell-alias!' to change this.")
|
||||||
|
|
||||||
|
|
||||||
(defvar +eshell--default-aliases nil)
|
(defvar +eshell--default-aliases nil)
|
||||||
|
(defvar +eshell--company-backends '(company-files company-capf))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -72,6 +73,14 @@ You should use `set-eshell-alias!' to change this.")
|
||||||
eshell-glob-case-insensitive t
|
eshell-glob-case-insensitive t
|
||||||
eshell-error-if-no-glob t)
|
eshell-error-if-no-glob t)
|
||||||
|
|
||||||
|
(when (and (featurep! :completion company)
|
||||||
|
+eshell--company-backends)
|
||||||
|
(set-company-backend! 'eshell-mode +eshell--company-backends)
|
||||||
|
(add-hook 'eshell-mode-hook #'company-mode)
|
||||||
|
(setq-hook! 'eshell-mode-hook
|
||||||
|
company-idle-delay 0.1
|
||||||
|
company-frontends (cons 'company-tng-frontend company-frontends)))
|
||||||
|
|
||||||
;; Consider eshell buffers real
|
;; Consider eshell buffers real
|
||||||
(add-hook 'eshell-mode-hook #'doom-mark-buffer-as-real-h)
|
(add-hook 'eshell-mode-hook #'doom-mark-buffer-as-real-h)
|
||||||
|
|
||||||
|
@ -126,14 +135,15 @@ You should use `set-eshell-alias!' to change this.")
|
||||||
;; time `eshell-mode' is enabled. Why? It is not for us mere mortals to
|
;; time `eshell-mode' is enabled. Why? It is not for us mere mortals to
|
||||||
;; grasp such wisdom.
|
;; grasp such wisdom.
|
||||||
(map! :map eshell-mode-map
|
(map! :map eshell-mode-map
|
||||||
|
(:unless (featurep! :completion company)
|
||||||
|
:ig "TAB" #'+eshell/pcomplete
|
||||||
|
:ig [tab] #'+eshell/pcomplete)
|
||||||
:n "RET" #'+eshell/goto-end-of-prompt
|
:n "RET" #'+eshell/goto-end-of-prompt
|
||||||
:n [return] #'+eshell/goto-end-of-prompt
|
:n [return] #'+eshell/goto-end-of-prompt
|
||||||
:n "c" #'+eshell/evil-change
|
:n "c" #'+eshell/evil-change
|
||||||
:n "C" #'+eshell/evil-change-line
|
:n "C" #'+eshell/evil-change-line
|
||||||
:n "d" #'+eshell/evil-delete
|
:n "d" #'+eshell/evil-delete
|
||||||
:n "D" #'+eshell/evil-delete-line
|
:n "D" #'+eshell/evil-delete-line
|
||||||
:ig "TAB" #'+eshell/pcomplete
|
|
||||||
:ig [tab] #'+eshell/pcomplete
|
|
||||||
:ig "C-d" #'+eshell/quit-or-delete-char
|
:ig "C-d" #'+eshell/quit-or-delete-char
|
||||||
"C-s" #'+eshell/search-history
|
"C-s" #'+eshell/search-history
|
||||||
;; Emacs bindings
|
;; Emacs bindings
|
||||||
|
@ -174,3 +184,9 @@ You should use `set-eshell-alias!' to change this.")
|
||||||
(use-package! esh-help
|
(use-package! esh-help
|
||||||
:after eshell
|
:after eshell
|
||||||
:config (setup-esh-help-eldoc))
|
:config (setup-esh-help-eldoc))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package! esh-autosuggest
|
||||||
|
:after eshell
|
||||||
|
:init (add-to-list '+eshell--company-backends 'esh-autosuggest)
|
||||||
|
:config (setq esh-autosuggest-use-company-map t))
|
||||||
|
|
|
@ -5,3 +5,4 @@
|
||||||
(package! eshell-z)
|
(package! eshell-z)
|
||||||
(package! shrink-path)
|
(package! shrink-path)
|
||||||
(package! esh-help)
|
(package! esh-help)
|
||||||
|
(package! esh-autosuggest)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue