doomemacs/modules/completion/company
Henrik Lissner 22aeaec399
Refactor how company-backends are set and stored
Company backends are now built from an alist (+company-backend-alist),
which can be manipulated through set-company-backend!. Backends can now
be set to all children of a parent mode (text-mode, prog-mode, etc),
like so:

  (set-company-backend! :derived 'text-mode 'company-dabbrev)

or only for an exact major-mode:

  (set-company-backend! 'markdown-mode 'company-dabbrev-code)

Backends cascade. So combining the two examples above will cause
company-backends in a markdown-buffer (which is derived from text-mode)
to be (company-dabbrev-code company-dabbrev).
2018-07-30 03:43:42 +02:00
..
test Refactor how company-backends are set and stored 2018-07-30 03:43:42 +02:00
autoload.el Refactor how company-backends are set and stored 2018-07-30 03:43:42 +02:00
config.el Refactor how company-backends are set and stored 2018-07-30 03:43:42 +02:00
packages.el
README.org

:completion company

This module adds code-completion support, powered by company.

  • Uses company-quickhelp for documentation tooltips
  • Uses company-statistics to order results by usage frequency

/screenshots/company.png

Table of Contents   TOC

Install

Some languages require additional setup, and some languages may have no completion support at all.

Check the README.org in that language's module for details.

Configure

Auto-completion

By default, I've disabled auto-completion. This is my preference. I prefer to invoke company when I need it by calling company-complete manually (typically, bound to C-SPC in insert mode). However, some may not share my preference.

To enable auto-completion you must:

  1. Load company,
  2. and change company-idle-delay to a non-nil float (the default is 0.5)

For example:

(require 'company)
(setq company-idle-delay 0.2
      company-minimum-prefix-length 3)

Troubleshooting

If completion isn't working for you, please consider the following before posting a bug report:

  • If what you are expecting is popup-as-you-type completion (which is disabled by default), see the "Configure > Auto-completion" section above, which will instruct you on how to enable this.
  • Some languages don't have any auto-completion support at all.