A few things.
company
decides its backend based on the variable company-backends
. If you want a specific auto-completion backend, you must specify it in your init.el
file.
In general, you can read documentation on variables by using M-x apropos-variable
.
- To add a backend to company, call
(add-to-list 'company-backends '(<backend name>))
For example, to add Elisp completion, there is a backend called company-elisp
that comes with company.
To use this, you run (add-to-list 'company-backend '(company-elisp))
.
This will add company-elisp
to the list of backends that company
decides to use.
- Company runs through its list of backends in
company-backends
and performs a test to see if it should run a given backend for your current mode.
The first to pass the test is used. All others are ignored.
Now, looking at company-anaconda
, it recommends:
(eval-after-load "company"
'(add-to-list 'company-backends 'company-anaconda))
or, if you want both company-anaconda
and company-capf
together:
(eval-after-load "company"
'(add-to-list 'company-backends '(company-anaconda :with company-capf)))
Finally, you must add:
(add-hook 'python-mode-hook 'anaconda-mode)
Looking at the source code for company-anaconda
reveals that you must enable anaconda-mode
for company
to choose the company-anaconda
backend.