Maenken Systems Components

MSys Delphi Formatter

MSys Component

MSys Delphi Formatter Smart formatting in Delphi RAD Studio

Ctrl+D is back as an add-on

MSys Delphi Formatter

Source Code Formatting Plug-in for RAD Studio 13

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.

Plug-In for RAD Studio

MSys Delphi Formatter

Ctrl+D — a shortcut nobody ever forgets

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.

The MSys Delphi Formatter fills precisely this gap.

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.

MSys Delphi Formatter

Advantages

Give it a try

Here's what the plugin looks like in the IDE: Press Ctrl+D right here on this page—or click the button.

Demo.pas unformatted

    

The default profile in action: keywords, spaces, indentation, type formatting, and comment spacing—the line structure remains intact.

Before / After

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;

MSys Delphi Formatter

Safety first

A formatter works on your most valuable asset — the source code.

Preserving the meaning

Only layout and spelling change. The semantics remain untouched in any case.

Loss-free

The lexer captures every character — string contents and comments are passed through verbatim.

Idempotent

Format(Format(x)) = Format(x). Already formatted code remains stable.

Abort instead of risk

If the source code is faulty: nothing happens. The editor content remains exactly as it was.

MSys Delphi Formatter

Core Functions

  • over 80 settings on nine options pages
  • multi-line strings, generics, anonymous methods, inline declarations, attributes
  • the formatter reactivates the native IDE actions
  • one file in the repository and the whole team formats identically
  • the interface automatically follows the IDE language

MSys Delphi Formatter

Download for free now

Plug-in for Delphi RAD Studio 13

Support Requests & Suggestions

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.

MSys Delphi Formatter

Configuration with System

Settings are merged with clear priority — the closest one wins.

Project — .editorconfig

The formatting rules travel with the repository. Standard keys plus own delphi_*-namespace. Perfect for teams.

Global — Options dialog

The personal settings under Tools > Options > MSys > Delphi Formatter

Built-in Standard

A deliberately conservative profile that delivers good results immediately — without overhauling the code.

MSys Delphi Formatter

Reference of the settings options

All options at a glance

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

Delphi Plug-in

Developer Tools by Maenken Systems

Discover more exciting tools from us

MSys Tool Suite

MSys Tool Suite

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.

Developer Tools

SBOM Monitor

A central dashboard for SBOM management, vulnerability monitoring, and compliance—within your infrastructure.