3 ms·
lsp-mode or eglot and company combined with clangd works very well. I also just use the built in "c++-mode" for the major mode. None of these packages are buil
by chlorion 4y ago
lsp-mode or eglot and company combined with clangd works very well. I also just use the built in "c++-mode" for the major mode.
None of these packages are built into Emacs, but eglot and company are on elpa which means they are a "package-install" command away. melpa packages (which lsp-mode is one of) are also pretty trivial to install, it just requires adding melpa to the package archive list variable then installing like normal.
Some Linux distros have these available to install with the system package manager. Even Debian has a decent bit of Emacs packages available. I personally use my distros system package manager to manage my Emacs packages since it has everything I need available.
- gpderetta 4y agoI also use lsp-mode+clangd and it works very well. I get completion, jump to definition/implementation/usage, type hints, inline docs, fix-it hints and some minor refactoring help. I do get some random emacs hangs from time to time (I assume it blocks waiting for some clangd output), likely due to an interaction between lsp-format-region and aggressive-indent-mode. It is an explicitly unsupported combination and it is resolved by killing clangd but it is a bit annoying. I should try eglot at some point.