spacemacs/contrib/auto-completion/README.md
syl20bnr 769d54da02 New layer auto-completion
Move company and auto-complete to a common layer.
They are not enabled globally anymore, each mode using them
must explicitly declare a hook.
Only one frontend is supported for a given mode, we have to
choose the best between the two.
Only one key binding to toggle auto-completion on `SPC t a` no
matter if it is company or auto-complete. The lighter in the
mode-line is Ⓐ for both frontends.
2015-04-03 00:28:13 -04:00

2.5 KiB

Auto-Completion configuration layer for Spacemacs

Table of Contents

Description

This layer provides auto-completion to Spacemacs. The following front-ends are supported:

  • [company][]
  • [auto-complete][]

Notes*

  • company is the most supported and preferred front-end in Spacemacs.
  • For a given language, Spacemacs supports one and only one front-end.

Install

To use this contribution add it to your ~/.spacemacs

(setq-default dotspacemacs-configuration-layers '(auto-completion))

Company variables

To use tab instead of enter to complete your selection, dotspacemacs/init set auto-completion-use-tab-instead-of-enter to t, for example:

(setq-default dotspacemacs-configuration-layers
  '(auto-completion :variables
                    auto-completion-use-tab-instead-of-enter t))

To enable docstring tooltips set auto-completion-enable-company-help-tooltip to t

(setq-default dotspacemacs-configuration-layers
  '(auto-completion :variables
                    auto-completion-enable-company-help-tooltip t))

Key Bindings

Company

No Debug         |                 Description

---------------------|------------------------------------------------------------ C-j | go down in company dropdown menu C-k | go up in company dropdown menu C-/ | search in company dropdown C-M-/ | filter the company dropdown menu C-d | open minibuffer with documentation of thing at point in company dropdown

Auto-complete

Key Binding    |                 Description

-------------------|------------------------------------------------------------ C-j | select next candidate C-k | select previous candidate TAB | expand selection or select next candidate S-TAB | select previous candidate return | complete word, if word is already completed insert a carriage return