You can configure Uiua's formatter by creating a file called .fmt.ua
in the directory from which you run the interpreter. This configuration file is also a Uiua program.
Configuration options are specified by binding values to specific names.
Example with default values:
TrailingNewline ← 1
CommentSpaceAfterHash ← 1
MultilineIndent ← 2
CompactMultilineMode ← "auto"
MultilineCompactThreshold ← 10
AlignComments ← 1
IndentItemImports ← 1
The following configuration options are available:
Type: boolean
Default: 1
Whether to add a trailing newline to the output.
Type: boolean
Default: 1
Whether to add a space after the #
in comments.
Type: natural number
Default: 2
The number of spaces to indent multiline arrays and functions
Type: "always"
, "never"
, or "auto"
Default: "auto"
The mode for formatting multiline arrays and functions.
"always"
: Always format multiline expressions in compact mode."never"
: Never format multiline expressions in compact mode."auto"
: Format multiline expressions in compact mode if they exceedMultilineCompactThreshold
.
Type: natural number
Default: 10
The number of characters on line preceding a multiline array or function, at or before which the multiline will be compact.
Type: boolean
Default: 1
Whether to align consecutive end-of-line comments
Type: boolean
Default: 1
Whether to indent item imports