Emacs¶
ClangFormat¶
The clang-format package
includes a minor mode to auto format on save called: clang-format-on-save-mode
.
This is an example of how it can be used with use-package
.
(use-package clang-format
:commands (clang-format-buffer clang-format-on-save-mode))
(add-hook 'c-mode-hook 'clang-format-on-save-mode)
(add-hook 'c++-mode-hook 'clang-format-on-save-mode)
(add-hook 'glsl-mode-hook 'clang-format-on-save-mode)
See How to clang-format the current buffer on save? for other examples.
RST¶
For editing reStructuredText for the user manual,
the following can be added to your ~/.emacs.d/init.el
.