2 releases

new 0.1.1 Dec 26, 2024
0.1.0 Dec 26, 2024

#341 in Development tools

Download history 206/week @ 2024-12-23

206 downloads per month

MIT license

49KB
580 lines

QMK Format

qmkfmt is a tool to format the keymaps section of a keymap.c file in qmk. It formats each LAYOUT entry under keymaps into a grid with aligned columns. If the --split-spaces argument is passed, it inserts the given nubmer of spaces in the center of each layout. If a row has less than the maximum number of columns (e.g. a thumb cluster), it is centered.

If clang-format is available on $PATH, qmkfmt will invoke it to format the rest of the file.

qmkfmt infers the number of rows from the number of lines in each LAYOUT.

Editor Setup

Helix

Put the following in .helix/languages.toml at the root of the qmk_firmware repository:

[[language]]
name = "c"
auto-format = true
formatter = { command = "qmkfmt", args = ["--split-spaces=8"] }

Dependencies

~9–19MB
~299K SLoC