This layer augments C++ support provided by Spacemacs` c-c++ layer.
- Adds
rtags
package for basic RTags support - Adds
company-rtags
package for RTags-powered completion - Adds
flycheck-rtags
for checking C++ code with RTags - Adds
helm-rtags
for Helm integration - Ensures RTags daemon (
rdm
) is started viacmake-ide-maybe-start-rdm
- Enables completion (via
company
) and linting (via adding a checker to and replacingflycheck
highligher) in C/C++ modes
Simply clone the repository into your emacs.d private directory:
git clone https://github.com/kzemek/cpp-rtags-layer ~/.emacs.d/private/c++-rtags
and enable the layer in ~/.spacemacs
along with c-c++
(without clang support):
...
dotspacemacs-configuration-layers
'( ...
c-c++
c++-rtags
...
)
...
If your c-c++
layer doesn't include cmake-ide
support you may additionally need to fetch it from develop
branch:
cd ~/.emacs.d && git fetch && git checkout origin/develop layers/+lang/c-c++/
- Install rtags
- on macOS this step is as simple as
brew install rtags
- on macOS this step is as simple as
- Set up
.dir-locals.el
- Create
compile_commands.json
in your build directory- for CMake projects it's enough to add
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
tocmake
invocation
- for CMake projects it's enough to add
Key Binding | Description |
---|---|
C <tab> |
Forces showing completions on current point (company-complete ) |
, g g |
Jumps to symbol definition (using RTags) |
, g f |
Apply Clang fixit |
C-c r |
Various rtags functions |