This layer adds configuration for C/C++ language as well support for CMake scripts.
Support syntax checking via flycheck with Clang.
Support for disassembly of code with disaster.
Support code reformatting with clang-format.
Support code navigation via cscope (when cscope layer is included) and gtags.
Support auto-completion (when auto-completion layer is included) via company-clang (when c-c++-enable-clang-support is turned on), or company-ycmd (when ycmd layer is included).
To use this configuration layer, add it to your ~/.spacemacs. You will need to add c-c++ to the existing dotspacemacs-configuration-layers list in this file.
By default header files are opened in c-mode, you can open them in c++-mode by setting the variable c-c++-default-mode-for-headers to c++-mode.
Note: To set the variable for a given project, create a directory local variable at the root of your project. More info on directory local variables can be found in the dir-locals.
clang-format allows reformatting either a selected region of code (clang-format-region) or a whole buffer (clang-format-buffer) to make it conform to a style defined in a .clang-format file. This file is either located in the same directory as the file being edited, or in any of its parent directories (otherwise a default style will be used).
This layer adds some fancy improvements to company-clang. 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.
Not only does this allow proper autocomplete on projects with extra includes and flags, but there is also support for flycheck so that it doesn't complain about missing header files.
SPC m r srefactor: refactor thing at point.