Fixed some issues with C formatting.

This commit is contained in:
Micheal Smith 2026-03-21 08:06:01 -05:00
parent 3a334a79e4
commit 60c2306e20
Signed by: xulfer
GPG key ID: 1BBF282038A8EC3E
3 changed files with 10 additions and 1 deletions

View file

@ -74,7 +74,9 @@ Might as well highlight the parentheses to make them easier to spot.
#+BEGIN_SRC emacs-lisp
(use-package apheleia
:config
(apheleia-global-mode +1))
(apheleia-global-mode +1)
(setf (alist-get 'c-ts-mode apheleia-mode-alist) '(clang-format))
(setf (alist-get 'c++-ts-mode apheleia-mode-alist) '(clang-format)))
#+END_SRC
** Indentation Level

View file

@ -30,6 +30,10 @@ the package.
;; if you want which-key integration
(lsp-mode . lsp-enable-which-key-integration))
:commands lsp-deferred
:custom
;; Let apheleia handle formatting; disable LSP's competing formatters
(lsp-enable-on-type-formatting nil)
(lsp-before-save-edits nil)
:config
(setq lsp-elixir-server-command '("elixir-ls")))

View file

@ -23,6 +23,9 @@ bother with an explanation on each.
;; C
(use-feature c-ts-mode
:custom
(c-ts-mode-indent-offset 2)
(c-ts-mode-indent-style 'k&r)
:config
(with-eval-after-load 'c-ts-mode
(setq-local treesit-primary-parser 'c)))