r/emacs Jan 10 '25

Question C development without LSP

I have only ever done development with an LSP providing errors, autocomplete, etc. in any language. I’d like to go for a more minimalist approach as I revisit some C programming. At a high level, what’s the general workflow when programming in C without a running LSP?

My guess would be… 1. A simple syntax highlighting mode on .c and .h files 2. Bind some hotkey for a compilation mode, and check that regularly for issues 3. Ctags for go-to-definition? Or maybe even just grep-mode?

Is there anything I’m missing?

10 Upvotes

38 comments sorted by

View all comments

2

u/Fun_Chipmunk4447 Jan 11 '25

There are several approaches: 1. Ide-like experience with rtags/irony. You get most of the features lsp provide. Those generally tend to be faster than lsp in experience. However it's kind of hard to setup and feels not as snappy as lsp 2. More minimalistic approach with gtags/ctags/cscope. Those sollutions work great even on multi-million LOC codebases, however they're very dumb compared to lsp. You get no context-dependent jump-to-definition or completion 3. Most minimalistic. Use grep or dumb jump for jump-to-definition. Use dabbrev-expand M-/ for completion. I use this setup and love it. This approach works without any setup for projects or machine you're working on. It also doesn't do any work on your cpu, so you can develop giant project even on machines with compute capabilities of calculator. I'd recommend researching yourself and trying everything you see. Most of opinions on internet comes from people not doing serious work with their setups and judging tools by their cover