mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
Documentation: Add clang-format variant to EmacsConfiguration.md
Add a variant of auto formatting using clang-format that doesn't use additional packages. It works by adding a buffer-local hook to `'before-save` for all C++ project files.
This commit is contained in:
parent
6744402dbf
commit
77f0a66d2f
Notes:
sideshowbarker
2024-07-17 08:22:21 +09:00
Author: https://github.com/Riyyi 🔰 Commit: https://github.com/SerenityOS/serenity/commit/77f0a66d2f Pull-request: https://github.com/SerenityOS/serenity/pull/14789
1 changed files with 6 additions and 0 deletions
|
@ -54,4 +54,10 @@ There are multiple packages to handle auto formatting with
|
|||
- [format-all-mode](https://github.com/lassik/emacs-format-all-the-code)
|
||||
- [clang-format-plus](https://github.com/SavchenkoValeriy/emacs-clang-format-plus)
|
||||
|
||||
Alternatively, this can be done without additional packages, using `lsp-mode`.
|
||||
You can use the following `.dir-locals.el` file placed in the project root:
|
||||
|
||||
```lisp
|
||||
((c++-mode
|
||||
(eval add-hook 'before-save-hook #'lsp-format-buffer nil t)))
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue