2014-11-04 15:11:25 +00:00
|
|
|
# Company Mode
|
|
|
|
|
2015-02-25 01:51:12 +00:00
|
|
|
This contrib layer switches spacemacs to use company-mode for
|
|
|
|
autocompletion. It automatically uninstalls all auto-complete-mode
|
|
|
|
related packages when you include it.
|
2014-11-08 17:21:27 +00:00
|
|
|
|
|
|
|
## Clang Fanciness
|
|
|
|
|
|
|
|
In `funcs.el` there are some fancy improvements to `company-clang`.
|
2015-02-25 01:51:12 +00:00
|
|
|
It includes a hook to load a projects `.clang_complete` file, which is
|
|
|
|
just a text file with one clang flag per line, a format also used by
|
|
|
|
other text editor clang plugins.
|
2014-11-08 17:21:27 +00:00
|
|
|
|
2015-02-25 01:51:12 +00:00
|
|
|
Not only does this allow proper autocomplete on projects with extra
|
|
|
|
includes and flags, but I also hooked it into flycheck so that the
|
|
|
|
error messages don't complain about missing header files and skip the
|
|
|
|
actual problems.
|
2014-11-08 17:21:27 +00:00
|
|
|
|
2015-02-25 01:51:12 +00:00
|
|
|
Basically, Spacemacs now has better Clang/C++ than any other Emacs
|
|
|
|
config.
|
2014-11-08 17:21:27 +00:00
|
|
|
|
2015-02-18 10:08:35 +00:00
|
|
|
## Key Bindings
|
|
|
|
|
|
|
|
No Debug | Description
|
|
|
|
---------------------|------------------------------------------------------------
|
|
|
|
<kbd>C-j</kbd> | go down in company dropdown menu
|
|
|
|
<kbd>C-k</kbd> | go up in company dropdown menu
|
|
|
|
<kbd>C-/</kbd> | search in company dropdown
|
|
|
|
<kbd>C-M-/</kbd> | filter the company dropdown menu
|
|
|
|
<kbd>C-d</kbd> | open minibuffer with documentation of thing at point in company dropdown
|
|
|
|
|
2015-02-18 11:19:46 +00:00
|
|
|
## Settings
|
|
|
|
|
2015-02-25 01:51:12 +00:00
|
|
|
To use tab instead of enter to complete your selection,
|
|
|
|
`dotspacemacs/init` set `company-mode-use-tab-instead-of-enter` to
|
|
|
|
true, for example:
|
|
|
|
|
|
|
|
``` elisp
|
2015-02-18 11:19:46 +00:00
|
|
|
(defun dotspacemacs/init ()
|
|
|
|
"User initialization for Spacemacs. This function is called at the very
|
|
|
|
startup."
|
2015-02-25 01:51:12 +00:00
|
|
|
(setq company-mode-use-tab-instead-of-enter t)
|
2015-02-18 11:19:46 +00:00
|
|
|
)
|
|
|
|
```
|
|
|
|
|
2014-11-08 17:21:27 +00:00
|
|
|
## Maintainer
|
|
|
|
|
|
|
|
This contrib layer was written by and should be maintained by @trishume, everyone else is
|
|
|
|
welcome to contribute.
|