diff --git a/config/formatting.org b/config/formatting.org index b18c1e3..a32e122 100644 --- a/config/formatting.org +++ b/config/formatting.org @@ -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 diff --git a/config/lsp.org b/config/lsp.org index 0aead37..c04c0a0 100644 --- a/config/lsp.org +++ b/config/lsp.org @@ -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"))) diff --git a/config/major_modes.org b/config/major_modes.org index be99e9d..93b19f5 100644 --- a/config/major_modes.org +++ b/config/major_modes.org @@ -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)))