company-mode

Modular in-buffer completion framework for Emacs

View on GitHub

About

Company is a text completion framework for Emacs. The name stands for "complete anything". It uses pluggable back-ends and front-ends to retrieve and display completion candidates.

It comes with several back-ends such as Elisp, Clang, Semantic, Eclim, Ropemacs, Ispell, CMake, BBDB, Yasnippet, dabbrev, etags, gtags, files, keywords and a few others.

The CAPF back-end, which has to be enabled manually on Emacs versions <24.4, provides a bridge to the standard completion-at-point-functions facility, and thus works with any major mode that defines a proper completion function.

Screenshots

company-elisp company-semantic

Installation

This package is part of GNU ELPA (M-x list-packages).

Advanced users can also download the development snapshot.

Usage

Once installed, enable company-mode with M-x company-mode.

Completion will start automatically after you type a few letters. Use M-n and M-p to select, <return> to complete or <tab> to complete the common part. Search through the completions with C-s, C-r and C-o. Press M-(digit) to quickly complete with one of the first 10 candidates.

Type M-x company-complete to initiate completion manually. Bind this command to a key combination of your choice.

When the completion candidates are shown, press <f1> to display the documentation for the selected candidate, or C-w to see its source. Not all back-ends support this.

To use company-mode in all buffers, add the following line to your init file:

(add-hook 'after-init-hook 'global-company-mode)

To see or change the list of enabled back-ends, type M-x customize-variable RET company-backends. Also see its description for information on writing a back-end.

For information on specific back-ends, also check out the comments inside the respective files.

For more information, type M-x describe-function RET company-mode.

To customize other aspects of its behavior, type M-x customize-group RET company.

See Also

Feedback

If you experience any problems or have a feature request, please use the issue tracker.

Contributing

Company is subject to the same copyright assignment policy as Emacs itself, org-mode, CEDET and other packages in GNU ELPA. Any legally significant contributions are only accepted after the author has completed their paperwork.

More Reading