This layer augments C++ support provided by Spacemacs` c-c++ layer.
- Adds
rtagspackage for basic RTags support - Adds
company-rtagspackage for RTags-powered completion - Adds
flycheck-rtagsfor checking C++ code with RTags - Adds
helm-rtagsfor 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 replacingflycheckhighligher) 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++-rtagsand 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.jsonin your build directory- for CMake projects it's enough to add
-DCMAKE_EXPORT_COMPILE_COMMANDS=ONtocmakeinvocation
- 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 |