Skip to navigation
To format c code with Emacs
13.03.26
## install on your os ``` apt-get install clang-format ``` in my init.el emacs file ``` (unless(package-installed-p 'clang-format) (package-refresh-contents) (package-install 'clang-format) ) (unless(package-installed-p 'format-all) (package-refresh-contents) (package-install 'elpa-format-all) ) ; Format C code (use-package format-all :commands format-all-mode :hook (prog-mode . format-all-mode) :config (setq-default format-all-formatters '(("C" (clang-format)) ("Shell" (shfmt "-i" "2" "-ci"))))) ```
https://github.com/lassik/emacs-format-all-the-code
Reply
Anonymous
Information Epoch 1775865544
Live free or die.
Home
Notebook
Contact us