Fixed some issues with C formatting.
This commit is contained in:
parent
3a334a79e4
commit
60c2306e20
3 changed files with 10 additions and 1 deletions
|
|
@ -74,7 +74,9 @@ Might as well highlight the parentheses to make them easier to spot.
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package apheleia
|
(use-package apheleia
|
||||||
:config
|
: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
|
#+END_SRC
|
||||||
|
|
||||||
** Indentation Level
|
** Indentation Level
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ the package.
|
||||||
;; if you want which-key integration
|
;; if you want which-key integration
|
||||||
(lsp-mode . lsp-enable-which-key-integration))
|
(lsp-mode . lsp-enable-which-key-integration))
|
||||||
:commands lsp-deferred
|
: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
|
:config
|
||||||
(setq lsp-elixir-server-command '("elixir-ls")))
|
(setq lsp-elixir-server-command '("elixir-ls")))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ bother with an explanation on each.
|
||||||
|
|
||||||
;; C
|
;; C
|
||||||
(use-feature c-ts-mode
|
(use-feature c-ts-mode
|
||||||
|
:custom
|
||||||
|
(c-ts-mode-indent-offset 2)
|
||||||
|
(c-ts-mode-indent-style 'k&r)
|
||||||
:config
|
:config
|
||||||
(with-eval-after-load 'c-ts-mode
|
(with-eval-after-load 'c-ts-mode
|
||||||
(setq-local treesit-primary-parser 'c)))
|
(setq-local treesit-primary-parser 'c)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue