completion/company: +auto by default
Questions regarding "completion not working" are very common, so the +auto flag has been removed and idle completion enabled by default.
This commit is contained in:
parent
3019b02d7d
commit
04acb8fa98
3 changed files with 8 additions and 32 deletions
|
@ -15,7 +15,7 @@
|
||||||
Modules that provide new interfaces or frameworks for completion, including code
|
Modules that provide new interfaces or frameworks for completion, including code
|
||||||
completion.
|
completion.
|
||||||
|
|
||||||
+ [[file:completion/company/README.org][company]] =+auto +childframe +tng=: The ultimate code completion backend
|
+ [[file:completion/company/README.org][company]] =+childframe +tng=: The ultimate code completion backend
|
||||||
+ helm =+fuzzy +childframe=: *Another* search engine for love and life
|
+ helm =+fuzzy +childframe=: *Another* search engine for love and life
|
||||||
+ ido: The /other/ *other* search engine for love and life
|
+ ido: The /other/ *other* search engine for love and life
|
||||||
+ [[file:completion/ivy/README.org][ivy]] =+fuzzy +childframe=: /The/ search engine for love and life
|
+ [[file:completion/ivy/README.org][ivy]] =+fuzzy +childframe=: /The/ search engine for love and life
|
||||||
|
|
|
@ -12,10 +12,8 @@
|
||||||
- [[#code-completion][Code completion]]
|
- [[#code-completion][Code completion]]
|
||||||
- [[#vim-esque-omni-completion-prefix-c-x][Vim-esque omni-completion prefix (C-x)]]
|
- [[#vim-esque-omni-completion-prefix-c-x][Vim-esque omni-completion prefix (C-x)]]
|
||||||
- [[#configuration][Configuration]]
|
- [[#configuration][Configuration]]
|
||||||
- [[#enable-as-you-typeidle-code-completion][Enable as-you-type/idle code completion]]
|
|
||||||
- [[#enable-company-backends-in-certain-modes][Enable company backend(s) in certain modes]]
|
- [[#enable-company-backends-in-certain-modes][Enable company backend(s) in certain modes]]
|
||||||
- [[#troubleshooting][Troubleshooting]]
|
- [[#troubleshooting][Troubleshooting]]
|
||||||
- [[#code-completion-doesnt-pop-up-automatically][Code-completion doesn't pop up automatically.]]
|
|
||||||
- [[#x-mode-doesnt-have-code-completion-support-or-requires-extra-setup][X-mode doesn't have code completion support or requires extra setup.]]
|
- [[#x-mode-doesnt-have-code-completion-support-or-requires-extra-setup][X-mode doesn't have code completion support or requires extra setup.]]
|
||||||
- [[#no-backends-or-the-incorrect-ones-have-been-registered-for-x-mode][No backends (or the incorrect ones) have been registered for X-mode.]]
|
- [[#no-backends-or-the-incorrect-ones-have-been-registered-for-x-mode][No backends (or the incorrect ones) have been registered for X-mode.]]
|
||||||
|
|
||||||
|
@ -26,7 +24,6 @@ for code completion in many of Doom's :lang modules.
|
||||||
https://assets.doomemacs.org/completion/company/overlay.png
|
https://assets.doomemacs.org/completion/company/overlay.png
|
||||||
|
|
||||||
** Module Flags
|
** Module Flags
|
||||||
+ =+auto= Enables as-you-type completion.
|
|
||||||
+ =+childframe= Enables displaying completion candidates in a child frame,
|
+ =+childframe= Enables displaying completion candidates in a child frame,
|
||||||
rather than an overlay or tooltip (among with other UI enhancements). *This
|
rather than an overlay or tooltip (among with other UI enhancements). *This
|
||||||
requires GUI Emacs 26.1+.*
|
requires GUI Emacs 26.1+.*
|
||||||
|
@ -48,12 +45,11 @@ major mode's module's documentation for details.
|
||||||
|
|
||||||
* Features
|
* Features
|
||||||
** Code completion
|
** Code completion
|
||||||
Ccompletion must be triggered manually with the =C-SPC= key. If you want
|
By default, completion is triggered after a short idle period or with the
|
||||||
as-you-type code completion, the ~+auto~ module flag will enable it.
|
=C-SPC= key. While the popup is visible, the following keys are available:
|
||||||
|
|
||||||
| Keybind | Description |
|
| Keybind | Description |
|
||||||
|---------+------------------------------------------|
|
|---------+------------------------------------------|
|
||||||
| =C-SPC= | Invoke code completion manually |
|
|
||||||
| =C-n= | Go to next candidate |
|
| =C-n= | Go to next candidate |
|
||||||
| =C-p= | Go to previous candidate |
|
| =C-p= | Go to previous candidate |
|
||||||
| =C-j= | (evil) Go to next candidate |
|
| =C-j= | (evil) Go to next candidate |
|
||||||
|
@ -84,14 +80,6 @@ available to evil users to access specific company backends:
|
||||||
| =C-x s= | Complete spelling suggestions |
|
| =C-x s= | Complete spelling suggestions |
|
||||||
|
|
||||||
* Configuration
|
* Configuration
|
||||||
** Enable as-you-type/idle code completion
|
|
||||||
The =+auto= module flag enables this feature.
|
|
||||||
|
|
||||||
Otherwise, ~M-x +company/toggle-auto-completion~ will toggle this interactively.
|
|
||||||
|
|
||||||
Customize ~company-idle-delay~ to control how quickly the popup should appear.
|
|
||||||
The default is ~0.2s~.
|
|
||||||
|
|
||||||
** Enable company backend(s) in certain modes
|
** Enable company backend(s) in certain modes
|
||||||
The ~set-company-backend!~ function exists for setting ~company-backends~
|
The ~set-company-backend!~ function exists for setting ~company-backends~
|
||||||
buffer-locally in MODES, which is either a major-mode symbol, a minor-mode
|
buffer-locally in MODES, which is either a major-mode symbol, a minor-mode
|
||||||
|
@ -122,15 +110,6 @@ To unset the backends for a particular mode, pass ~nil~ to it:
|
||||||
If code completion isn't working for you, consider the following common causes
|
If code completion isn't working for you, consider the following common causes
|
||||||
before you file a bug report:
|
before you file a bug report:
|
||||||
|
|
||||||
** Code-completion doesn't pop up automatically.
|
|
||||||
This is by design. The expectation is that you invoke completion manually with
|
|
||||||
=C-SPC=. This was decided because code-completion backends can be slow, some
|
|
||||||
dreadfully so, and invoking them every time you move your cursor can add pauses
|
|
||||||
and delays while editing.
|
|
||||||
|
|
||||||
If, despite that, you still want this functionality, use the =+auto= flag to
|
|
||||||
enable it.
|
|
||||||
|
|
||||||
** X-mode doesn't have code completion support or requires extra setup.
|
** X-mode doesn't have code completion support or requires extra setup.
|
||||||
There is no guarantee your language mode will have completion support.
|
There is no guarantee your language mode will have completion support.
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
(def-package! company
|
(def-package! company
|
||||||
:commands (company-complete-common company-manual-begin company-grab-line)
|
:commands (company-complete-common company-manual-begin company-grab-line)
|
||||||
|
:after-call (evil-insert-state-entry-hook evil-emacs-state-entry-hook)
|
||||||
:init
|
:init
|
||||||
(setq company-idle-delay nil
|
(setq company-minimum-prefix-length 2
|
||||||
company-tooltip-limit 14
|
company-tooltip-limit 14
|
||||||
company-dabbrev-downcase nil
|
company-dabbrev-downcase nil
|
||||||
company-dabbrev-ignore-case nil
|
company-dabbrev-ignore-case nil
|
||||||
|
@ -16,6 +17,9 @@
|
||||||
company-frontends
|
company-frontends
|
||||||
'(company-pseudo-tooltip-frontend
|
'(company-pseudo-tooltip-frontend
|
||||||
company-echo-metadata-frontend))
|
company-echo-metadata-frontend))
|
||||||
|
;; Lazy load until user starts entering text
|
||||||
|
(unless (featurep! :editor evil)
|
||||||
|
(add-transient-hook! 'post-self-insert-hook (require 'company)))
|
||||||
:config
|
:config
|
||||||
(add-hook 'company-mode-hook #'+company|init-backends)
|
(add-hook 'company-mode-hook #'+company|init-backends)
|
||||||
(when (featurep! :editor evil)
|
(when (featurep! :editor evil)
|
||||||
|
@ -23,13 +27,6 @@
|
||||||
(global-company-mode +1))
|
(global-company-mode +1))
|
||||||
|
|
||||||
|
|
||||||
(def-package! company
|
|
||||||
:when (featurep! +auto)
|
|
||||||
:defer 2
|
|
||||||
:after-call post-self-insert-hook
|
|
||||||
:config (setq company-idle-delay 0.1))
|
|
||||||
|
|
||||||
|
|
||||||
(def-package! company-tng
|
(def-package! company-tng
|
||||||
:when (featurep! +tng)
|
:when (featurep! +tng)
|
||||||
:defer 2
|
:defer 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue