Welcome Language Server Protocol
I’ve put a lot of effort to get YouCompleteMe and rtags configured and running: deployed compactly, updated automatically, adapted to vim, managed. And they served well until I found a better solution: language server protocol (LSP). It turns out to be as robust as simple to configure nowadays.
To get it running, just few steps were needed:
-
Install cquery, a package for which is available in AUR: cquery
-
Install and configure an LSP client for neovim
-
Install and configure deoplete, neosnippet.
There are two ways to configure a project: either placing a file named .cquery
in the project root, which must be convenient for simpler projects, or leaving
compile_commands.json
in the project root. While the latter is usually
generated with cmake (-DCMAKE_EXPORT_COMPILE_COMMANDS=Yes
), the former can
easily be crafted with a pair of commands (see
cquery-init).
The setup allows to get whatever is needed for development in C++:
- code completion
- code navigation
- on-the-fly check
- symbol search
- symbol renaming
Thus, it’s safe to remove YCM and rtags now.