A Post-Apocalyptic RPG



Emacs and C

I've been using a certain company's line of development environments for years, and probably still will for work, but like a lot of other products it's a) pushing more AI and b) just emailed me their new acceptable use policy, which I'd probably never violate, but give me the feeling that they have the means to shut off my ability to use the program at any time.

So, I decided to see if Emacs would make a good replacement for what I need.

I've been using Emacs off and on since I convinced my boss I needed to take a Java class back in '94. Configuration had always been a matter of searching the Internet for other users' .emacs (config) files, but a few years ago I stumbled on Spacemacs, which was kind of what I was looking for, which led me to Doom Emacs, which is what I'm using now (and, at this point, wouldn't use Emacs without).

Navigating projects

Once you have Doom Emacs configured with C and LSP support, you'll get similar language hints that you'd see in CLion or VS Code. Using Projectile and regular Emacs keybindings let you navigate your project. (Emacs keybindings below, if you're using Evil (vi) mode, adjust accordingly).

  • C-c p ? - Find References
  • C-c p s - Search for a string in the project files (requires ripgrep)
  • C-c p a - Switch between the currently open .c and .h file
  • C-x b - Switch between open files
  • C-c p c c - build/compile project
  • C-c p f - Find file in current project

I'll add more keybindings here as I use them and maybe more info on my setup here if I think anyone's interested.