2017-08-21 20:07:07 +02:00
|
|
|
#+TITLE: :completion company
|
2017-05-25 20:08:50 +02:00
|
|
|
|
2017-08-21 20:07:07 +02:00
|
|
|
This module adds code-completion support, powered by [[https://github.com/company-mode/company-mode][company]].
|
2017-05-25 20:08:50 +02:00
|
|
|
|
|
|
|
+ Uses ~company-quickhelp~ for documentation tooltips
|
|
|
|
+ Uses ~company-statistics~ to order results by usage frequency
|
|
|
|
|
|
|
|
[[/../screenshots/company.png]]
|
|
|
|
|
2017-08-21 20:07:07 +02:00
|
|
|
* Table of Contents :TOC:
|
|
|
|
- [[#install][Install]]
|
|
|
|
- [[#configure][Configure]]
|
|
|
|
- [[#auto-completion][Auto-completion]]
|
|
|
|
- [[#troubleshooting][Troubleshooting]]
|
2017-05-25 20:08:50 +02:00
|
|
|
|
2017-08-21 20:07:07 +02:00
|
|
|
* Install
|
2017-12-31 23:07:28 -05:00
|
|
|
Some languages require additional setup, and some languages may have no
|
|
|
|
completion support at all.
|
2017-05-25 20:08:50 +02:00
|
|
|
|
2017-08-21 20:07:07 +02:00
|
|
|
Check the README.org in that language's module for details.
|
2017-05-25 20:08:50 +02:00
|
|
|
|
2017-08-21 20:07:07 +02:00
|
|
|
* Configure
|
|
|
|
** Auto-completion
|
2017-12-31 23:07:28 -05:00
|
|
|
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.
|
2017-05-25 20:08:50 +02:00
|
|
|
|
2017-08-21 20:07:07 +02:00
|
|
|
To enable auto-completion you must:
|
2017-05-25 20:08:50 +02:00
|
|
|
|
|
|
|
1. Load ~company~,
|
|
|
|
2. and change ~company-idle-delay~ to a non-nil float (the default is 0.5)
|
|
|
|
|
2017-12-31 23:07:28 -05:00
|
|
|
For example:
|
2017-05-25 20:08:50 +02:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(require 'company)
|
|
|
|
(setq company-idle-delay 0.2
|
|
|
|
company-minimum-prefix-length 3)
|
|
|
|
#+END_SRC
|
|
|
|
|
2017-08-21 20:07:07 +02:00
|
|
|
* Troubleshooting
|
2017-12-31 23:07:28 -05:00
|
|
|
If completion isn't working for you, please consider the following before
|
|
|
|
posting a bug report:
|
2017-05-25 20:08:50 +02:00
|
|
|
|
2017-12-31 23:07:28 -05:00
|
|
|
+ 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.
|