MSys Delphi Formatter
Advantages
More customisation options
Understand modern Delphi
Respects your layout
Ctrl+D is back as an add-on
The MSys Delphi Formatter brings source code formatting back to RAD Studio 13 — lossless, configurable, and entirely according to your own rules.
RAD Studio 13 has removed the built-in formatter. This plug-in fills the gap — and goes far beyond what its predecessor ever did.
Who doesn’t remember this from earlier versions of Delphi? A quick press of Ctrl+D — and the source code would appear just as it should: neatly indented, consistently formatted, and easy to read. A shortcut deeply ingrained in the muscle memory of every Delphi developer, as second nature as F9 for compiling.
With RAD Studio 13, this gesture was suddenly a thing of the past: the built-in source code formatter is no longer included. Every project quickly feels the impact of this — inconsistent styling, haphazard spacing, and indentation that varies depending on the developer’s mood. And code reviews that focus on aesthetics rather than substance.
Ctrl+D works again — in exactly the same places as before: in the editor, in the Edit menu, and in the context menu. No need to get used to anything new, no new workflow. Just carry on working as if the formatter had never been gone.
Here's what the plugin looks like in the IDE: Press Ctrl+D right here on this page—or click the button.
The default profile in action: keywords, spaces, indentation, type formatting, and comment spacing—the line structure remains intact.
Three real-world examples — each rule can be enabled or disabled individually.
// Before
BEGIN
X:=A+B;
FOO(a,b,C1); {init}
end;
// After (Standard Profile)
begin
X := A + B;
FOO(a, b, C1); { init }
end;// “Like first occurrence”: one identifier, one spelling—unit-wide // Before MyVar := 1; myvar := 2; MYVAR := 3; // After MyVar := 1; MyVar := 2; MyVar := 3;
// “uses: one unit per line” = Line break // Before uses System.SysUtils, System.Classes, System.Generics.Collections; // After uses System.SysUtils, System.Classes, System.Generics.Collections;
A formatter works on your most valuable asset — the source code.
Only layout and spelling change. The semantics remain untouched in any case.
The lexer captures every character — string contents and comments are passed through verbatim.
Format(Format(x)) = Format(x). Already formatted code remains stable.
If the source code is faulty: nothing happens. The editor content remains exactly as it was.
Plug-in for Delphi RAD Studio 13
Whether it's a support request, a suggestion for improvement, or a new feature request—you can easily submit your request through our ticket system and track its status at any time.
Settings are merged with clear priority — the closest one wins.
The formatting rules travel with the repository. Standard keys plus own delphi_*-namespace. Perfect for teams.
The personal settings under Tools > Options > MSys > Delphi Formatter
A deliberately conservative profile that delivers good results immediately — without overhauling the code.
— Standard refers to the built-in Maenken profile. —
The basic formatting of every file: indentation, line breaks, spaces at the end of lines, and closing line breaks — in line with the classic EditorConfig principles.
|
Setting
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Indent mark
|
Space / Tab
|
Space
|
What is used for indentation
|
|
Feed width
|
Integer
|
2
|
Columns per indentation level
|
|
Remove trailing whitespace
|
On / Off
|
On
|
Removes spaces at the end of a line
|
|
Remove trailing whitespace
|
Columns per indentation level
|
Columns per indentation level
|
Columns per indentation level
|
|
Ensure a full stop is followed by a line break
|
On / Off
|
On
|
Exactly one line break at the end of the file
|
|
End of line
|
System / CRLF / LF / CR
|
System
|
Normalises the line break style
|
How deeply are block contents, case branches and continuation lines indented? The default profile indents blocks and the declaration section neatly — deeper indentation options are available on request.
|
Settings
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Indent mark
|
On / Off
|
On
|
Content within begin/end, try, case, repeat
|
|
Case contents / Case brands
|
On / Off
|
On
|
Indent case branches and labels
|
|
Indent by section
|
On / Off
|
Off
|
Indent ‘interface’ and ‘implementation’ further
|
|
Continuation collection
|
Integer
|
2
|
Indentation of line breaks
|
|
No indent from the column
|
Integer
|
40
|
Covers the feed gap in cases of deep nesting
|
Delphi is case-insensitive — but the human eye is not. Separately configurable rules for keywords, directives, numbers, types and identifiers.
|
Settings
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Reserved words
|
Unchanged / LARGE / small / First large
|
small
|
BEGIN → begin
|
|
Compiler directives
|
Unchanged / LARGE / small / First large
|
LARGE
|
{$ifdef} → {$IFDEF} (arguments remain unchanged)
|
|
Numbers (hexadecimal / exponent)
|
Unchanged / LARGE / small / First large
|
LARGE
|
$1abc → $1ABC, 1e5 → 1E5
|
|
Built-in models
|
… / Pascal (kanonisch)
|
Pascal
|
integer → Integer, nativeint → NativeInt
|
|
Other identifiers
|
… / As the first occurrence
|
Unchanged
|
Standardises across the entire unit to the first occurrence
|
Micro-typography: spacing around commas, operators, colons and comment brackets — with a defined tie-breaker in the event of conflicting rules.
|
Settings
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Comma / Semicolon / Colon
|
None / before / after / both / unchanged
|
Only after that
|
Foo(a,b) → Foo(a, b)
|
|
Assignment / binary operators
|
None / before / after / both / unchanged
|
both
|
x:=1+2 → x := 1 + 2
|
|
Unary operators
|
None / before / after / both / unchanged
|
None
|
- 1 → -1 (note the words remain separate)
|
|
Brace comment { }
|
None / inside / outside / both
|
Inside and outside
|
{x} → { x }
|
|
Internal spacing between brackets / Generics
|
On / Off
|
Off
|
TList → TList
|
The formatter’s most important option: ‘Preserve user line breaks’ (default: on) leaves the line structure unchanged. Only when this option is turned off do the line-break rules take effect — from the `begin` style to the `uses` list.
|
Settings
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Retain user line breaks
|
On / Off
|
On
|
Master switch for all line-break rules
|
|
Position of 'begin'
|
As entered / K&R / Allman
|
As entered
|
begin at the end of the line or on a new line
|
|
uses: one unit per line
|
As entered / Collapse / Wrap
|
As entered
|
A line break after every comma in the ‘uses’ list
|
|
Combine ‘end’ and ‘else’
|
On / Off
|
On
|
end + else → end else
|
Parameters per line, inheritance lists, property accessors — and the smart ‘If too long’ mode: only text that would extend beyond the right-hand margin is wrapped.
|
Settings
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Parameters per line (call / definition)
|
As entered / Collapse / Wrap
|
As entered
|
One parameter per line
|
|
Inheritance list / Array initialisation
|
… / If too long
|
As entered
|
Line breaks only for excessively long lines
|
|
Right-hand margin (column)
|
Integer
|
120
|
Threshold for the ‘if too long’ automatic function
|
Vertical rhythm: The folding limit always clears up clusters of blank lines; structure separators create targeted white space when reflow is active.
|
Settings
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Maximum number of consecutive blank lines
|
Integer
|
1
|
Collapse sequences of blank lines (always applies)
|
|
Maximum number of consecutive blank lines
|
Integer
|
1
|
Blank lines between methods
|
|
Maximum number of consecutive blank lines
|
Integer
|
1
|
Air around unit sections
|
The finishing touches for fans of columnar formatting — fully opt-in: assignments, type names, constants and end-of-line comments are aligned in a single column.
|
Settings
|
Values
|
Standard
|
Effect
|
|---|---|---|---|
|
Assignments / Constants / Type names …
|
On / Off
|
Off
|
Columnar layout by category
|
|
Aligning end-of-line comments
|
On / Off
|
Off
|
Comments displayed in a column
|
|
Max. column
|
Integer
|
60
|
Upper limit of the target anchor column
|
The finishing touches for fans of a columnar layout — fully opt-in: assignments, type names, constants and end-of-line comments are aligned in a single column.
|
Settings
|
Effect
|
|---|---|
|
Enable formatting
|
Global on/off switch for Ctrl+D, Menu and context menu
|
|
Import… (.config)
|
Reads Together profiles from Delphi 12 and earlier — with a transparent import report
|
|
export… (.config)
|
Share your own settings as a .config file
|
Discover more exciting tools from us
MSys Tool Suite is a modular plugin suite for RAD Studio 13. It extends the Delphi IDE with project-related task management, an AI interface via MCP, automatic SBOM generation, and productive IDE helpers.
A central dashboard for SBOM management, vulnerability monitoring, and compliance—within your infrastructure.