Use editorconfig!
this post was submitted on 19 Nov 2023
1 points (100.0% liked)
Emacs
311 readers
2 users here now
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
Get Emacs
Rules
- Posts should be emacs related
- Be kind please
- Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.
Emacs Resources
Emacs Tutorials
- Beginner’s Guide to Emacs
- Absolute Beginner's Guide to Emacs
- How to Learn Emacs: A Hand-drawn One-pager for Beginners
Useful Emacs configuration files and distributions
Quick pain-saver tip
founded 1 year ago
MODERATORS
(setq c-default-style "stroustrup")
I think you’re looking for ‘c-basic-offset’, although I’d echo the sentiment that you should use a formatter instead. For that you can check out the reformatter package, which lets you setup hooks based on the programming mode to invoke the formatter of your choice, e.g. setup a hook for c/c++ to use clang format or whatever you’d
c-basic-offset did not work. that was the first thing i tried.