Re-enable company globally with :defer 2

This commit is contained in:
syl20bnr 2015-04-09 01:17:49 -04:00
parent e72afd6086
commit 965dc56817
2 changed files with 6 additions and 18 deletions

View file

@ -8,7 +8,7 @@
- [Install](#install) - [Install](#install)
- [Company variables](#company-variables) - [Company variables](#company-variables)
- [Configure](#configure) - [Configure](#configure)
- [Enable company or auto-complete globally](#enable-company-or-auto-complete-globally) - [Remove global activation of company](#remove-global-activation-of-company)
- [Replacing company by auto-complete](#replacing-company-by-auto-complete) - [Replacing company by auto-complete](#replacing-company-by-auto-complete)
- [Add auto-completion in a layer](#add-auto-completion-in-a-layer) - [Add auto-completion in a layer](#add-auto-completion-in-a-layer)
- [Key Bindings](#key-bindings) - [Key Bindings](#key-bindings)
@ -55,27 +55,14 @@ to `t`
## Configure ## Configure
### Enable company or auto-complete globally ### Remove global activation of company
By default Spacemacs enables auto-completion explicitly for each supported TODO (when use-package hooks will be used)
major-mode, it means that `company` and `auto-complete` are not enabled
globally, it allows more flexibility to choose an auto-completion engine
for a given mode.
You may want to enable company globally to get auto-completion
everywhere even in the modes which are not configured by Spacemacs. To do
so, you just have to add `(global-company-mode)` in the
`dotspacemacs/config` function of your dotfile.
Note that if you want to enable auto-complete globally you will have to
disable company first, see the next section to do so.
### Replacing company by auto-complete ### Replacing company by auto-complete
You can disable company by adding it to the `dotspacemacs-excluded-packages` You can disable company by adding it to the `dotspacemacs-excluded-packages`
variable, then you are free to configure auto-complete and enable it variable, then you are free to enable auto-complete globally.
globally.
```
### Add auto-completion in a layer ### Add auto-completion in a layer

View file

@ -65,7 +65,7 @@ conflict.")
(defun auto-completion/init-company () (defun auto-completion/init-company ()
(use-package company (use-package company
:defer t :defer 2
:init :init
(progn (progn
(setq company-idle-delay 0.2 (setq company-idle-delay 0.2
@ -78,6 +78,7 @@ conflict.")
company-clang-prefix-guesser 'company-mode/more-than-prefix-guesser)) company-clang-prefix-guesser 'company-mode/more-than-prefix-guesser))
:config :config
(progn (progn
(global-company-mode)
(spacemacs|diminish company-mode "" " a") (spacemacs|diminish company-mode "" " a")
;; Set the completion key ;; Set the completion key
(if auto-completion-use-tab-instead-of-enter (if auto-completion-use-tab-instead-of-enter