Indent your code with GNU Indent
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Akib Azmain Turja ff3e10edbd
Remove obsolete use of define-minor-mode
3 months ago
COPYING Add code, readme and copying conditions 5 months ago
README.org Fix typos in README 3 months ago
gnu-indent.el Remove obsolete use of define-minor-mode 3 months ago

README.org

gnu-indent - Indent your code with GNU Indent

Keeping code correctly indented can be tedious. And when the project is large, maintaining a consistent style everywhere by hand can become almost impossible. gnu-indent solves this problem by doing the job itself. Enable gnu-indent-mode and continue with the your editing; your file will be reindented by GNU Indent just before saving it maintaining the position of point.

GNU Indent supports C, C++ is also partially supported.

Installation

Package

Add MELPA to package-archives then M-x package-install RET gnu-indent.

Quelpa

Do M-x quelpa RET gnu-indent, Quelpa should get the recipe from MELPA and install it.

Straight.el

Put this in (straight-use-package 'gnu-indent) your init file, Straight.el should get the recipe from MELPA and install it.

Commands

gnu-indent-mode
Toggle auto reindentation on save.
gnu-indent-buffer
Reindent current buffer.
gnu-indent-region
Reindent current region.

User options

gnu-indent-program
Name of GNU Indent program (default "indent").
gnu-indent-options
Arguments to pass to GNU Indent (default nil). You'd probably want to set it as a file local variable. See GNU Indent manual (C-h i m Indent RET on Emacs, info indent on shell) for available options.