Emacs as a C/C++ IDE

This is another of a series of posts on how to use Emacs as a C/C++ IDE. I’m always seeing queries about how to do that so it’s worth another post on the subject. This time, I want to discuss a series of videos by Baris Yuksel.

There are four videos. The first two cover the usual subjects of completion, yasnippets, iedit, flymake, and even google-cpplint. Most active developers probably have all that installed already (with the possible exception of google-cpplint). Still, if you’re starting from scratch, Yuksel shows what these do and why you might want to install them. These two videos cover the same ground—but in a different way—as Mike Zamasky’s C++ video.

The second two videos are the most interesting. They cover how to give Emacs semantic knowledge of C++. The third video illustrates this with cedit and the fourth shows how to do the same thing with irony/sarcasm if you’re a clang user. Either of these two methods give Emacs intellisence capabilities and you should definitely take a look if you do a lot of C/C++ programming.

The first 3 videos are all together in a panel with the first video. The fourth is separate but can be found here. The videos are all 6 to 8 minutes long so it’s easy to find time to watch them. The videos are from 2014 so they discuss previous versions of Emacs and the packages but most if not all of the material still applies today.

This entry was posted in Programming and tagged . Bookmark the permalink.
  • Perry Metzger

    So, an interesting set of new developments in the Emacs as C/C++ IDE world:

    1) Microsoft has created an interesting standard called the "language server protocol" or LSP: http://langserver.org/ — it is an open way for compilers and editors to talk to each other so the editor doesn't also have to parse code on its own.
    2) The Clang/LLVM people are working on an LSP implementation for Clang called clangd.
    3) There now seems to be a prototype LSP minor mode for Emacs.

    • jcs

      My days of serious C hacking are largely over but I'm still very happy about this. I hope that the gcc people get onboard and that we can get this into Emacs without the squabbling we had last time.

      • Perry Metzger

        LSP will help with things other than C and C++ too. It may help with just about any language, and make Emacs a much better IDE.

  • Perry Metzger

    Another update. In the course of discussion on the emacs developers list, RMS has said that he will urge the gcc developers to support the language server protocol. So I think in the long run, support for _all_ programming languages is going to get better.