Emacs as a C++ IDE

I often see Tweets or posts asking for help in finding a way of using Emacs as a C++ IDE. Mostly people turn to Eclipse for features such as

  • Jump to definition (of class, function, etc.)
  • Autocompletion
  • On-the-fly syntax highlighting
  • Find file in project
  • One key compilation
  • Graphical debuggers

Átila Neves, a long time Emacs user, took a job as a C++ programmer and started using Eclipse because everyone else at his new job was and because he wanted the features listed above. As every Emacs user will understand, he missed Emacs and started looking for a way to use it as an IDE that would provide at least the above functionality.

In this talk at CppCon 2015, Neves recounts how he made Emacs into a first class IDE that provides all the functionality that he was looking for. This involves using CMake, rtags, Flycheck, semantic, and a bit of custom Elisp (cmake-ide) to take information from the compiler about definitions and their locations and make them available to Emacs to enable easy navigation.

Neves has a quick demonstration of all this at work. Leveraging the compiler and CMake is a nice trick and provides for an intelligent IDE in a way that tools like CScope, that don’t actually understand the target language, can’t.

Neves’ talk is about 16 and quarter minutes so it’s easy to find time for it. If you’re looking for a great way to use Emacs as a C++ IDE, be sure to watch Neves’ video. It’s the best answer to the “How do I use Emacs as a C++ IDE?” question that I’ve seen. You can see his see his cmake-ide package on GitHub.

This entry was posted in Programming and tagged , , . Bookmark the permalink.