2015-12-02 14:23:39 +00:00
#+TITLE : YCMD layer
2015-06-10 16:44:30 +00:00
2016-03-31 02:59:55 +00:00
* Table of Contents :TOC_4_gh:noexport:
- [[#description ][Description ]]
- [[#install ][Install ]]
- [[#layer ][Layer ]]
- [[#ycmd ][YCMD ]]
- [[#other-requirements ][Other Requirements ]]
- [[#configuration ][Configuration ]]
- [[#key-bindings ][Key Bindings ]]
2015-06-10 16:44:30 +00:00
* Description
2015-06-10 21:16:01 +00:00
This layer adds [[https://github.com/abingham/emacs-ycmd ][emacs-ycmd ]] support.
2015-06-10 16:44:30 +00:00
* Install
** Layer
2016-01-06 05:21:55 +00:00
To use this configuration layer, add it to your =~/.spacemacs= . You will need to
add =ycmd= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-06-10 16:44:30 +00:00
** YCMD
2016-06-12 11:23:24 +00:00
1) Install the =ycm= server. Installation instructions can be found [[https://github.com/Valloric/ycmd#building ][here ]].
2) Set the =ycmd-server-command= variable to reflect the path to the installation:
#+BEGIN_SRC emacs-lisp
(setq ycmd-server-command '("python" "/path/to/YouCompleteMe/third_party/ycmd/ycmd"))
#+END_SRC
3) Instead of =.clang_complete= ycmd [[https://github.com/Valloric/YouCompleteMe/blob/master/README.md#c-family-semantic-completion ][uses a .ycm_extra_conf.py file ]].
4) Whitelist the file by adding the following to =.spacemacs= :
#+BEGIN_SRC emacs-lisp
;; In this example we whitelist everything in the Develop folder
(setq ycmd-extra-conf-whitelist '("~/Develop/ *"))
#+END_SRC
5) The completion is not going to work automatically until we actually force it:
#+BEGIN_SRC emacs-lisp
(setq ycmd-force-semantic-completion t)
#+END_SRC
2015-06-10 16:44:30 +00:00
** Other Requirements
This package requires the =auto-completion= layer in order to get actual
completion. The =syntax-checking= layer is required for flycheck support.
* Configuration
By default this layer only activates ycmd for =c++-mode= .
2016-04-21 03:18:12 +00:00
If you want ycmd support in other modes you might just want to add it for
2015-06-10 16:44:30 +00:00
specific languages like:
#+BEGIN_SRC emacs-lisp
(add-hook 'c++-mode-hook 'ycmd-mode)
#+END_SRC
* Key Bindings
Adds ~SPC m g g~ go to definition binding to =c++-mode= as well as ~SPC m g G~
for the more imprecise but faster version.