8

The formatter in Delphi 2010 is really an annoying thing to me. I prefer formatting my code manually. I believe I do it better.

How can I disable it?

NOTE: Answers on why I don't use it in the first place will not be accepted. I need it switched OFF. Nothing more, nothing less.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Gad D Lord
  • 6,620
  • 12
  • 60
  • 106
  • I know I can remap the Ctrl+D shortcut but is there a way to remove it completely? – Gad D Lord Nov 15 '09 at 21:10
  • How do you even know it is there if you don't explicitly invoke it? – Nick Hodges Nov 16 '09 at 00:13
  • @Nick, right-click in the source code. – Bruce McGee Nov 16 '09 at 01:33
  • 1
    @BruceWell, right, but the point is, what is the problem with its presence? Why the strong need to completely get rid of it? – Nick Hodges Nov 16 '09 at 05:04
  • 1
    It's probably a religious matter... – Svein Bringsli Nov 16 '09 at 08:20
  • I disabled it because I would sometimes hit Ctrl+D by accident, and make a big mess. – JosephStyons Nov 16 '09 at 15:47
  • Joseph, does Ctrl+Z not undo that? Anyway, merely changing the keyboard shortcut isn't sufficient for Gad, who wishes for complete removal of the feature. That's what Nick (and I) can't understand the reason for. – Rob Kennedy Nov 16 '09 at 18:09
  • He specifically asked to DISABLE it not remove it. I'm 99.9% certain that being able to disable the short-cut key was what he had in mind, but certain people have a tendency to get *very* precious and protective of things that *they* think are "good", and get all antagonistic and when anyone DARES have the temerity to suggest that they think differently. vis the old/new component palette debacle for a similar example. – Deltics Nov 16 '09 at 19:16
  • @Nick and Rob: I also sometimes accidentally hit Ctrl+D, and sometimes Ctrl+Z doesn't undo it. (This is usually C++ code - I hit Save often by habit which might stop Ctrl+Z working. In fact Ctrl+S is usually how I hit Ctrl+D by accident.) I find the formatting options aren't flexible enough for me to set up so it formats as I want so this wouldn't be a problem, so I'm also interested in how to disable it. – David Nov 16 '09 at 23:09
  • I need it removed since I wish some lines to be wrapped at symbol 80 and some at symbol 120. There is no option to switch the line wrapping only off. – Gad D Lord Nov 22 '09 at 13:32
  • And Ctrl+D is mapped as a shortkey to the ultimate cnWizards Procedure List screen. If there is option to disable wrapping at a particular symbol I may consider using the Formater. – Gad D Lord Jan 08 '10 at 21:08
  • Also, formatter does NOT cope with things like '^m^j' (for cr/lf) properly, and actively breaks the code. – Robbie Matthews Aug 10 '12 at 00:41

3 Answers3

12

Install DDevExtensions from Andreas Hausladen.
In its last version:
Version 2.0 (2009-09-13)
Added: Embarcadero RAD Studio 2010 support
Added: Editor tab double click action (zoom, super-zoom)
Added: Source Formatter hotkey (Ctrl+D) can be disabled

Francesca
  • 21,452
  • 4
  • 49
  • 90
8

Remove or rename the file Embarcadero.Modeling.Formatter.dll in Delphi's bin directory.

Bruce McGee
  • 15,076
  • 6
  • 55
  • 70
  • This is a much better answer (no extra software installation necessary) and it works perfectly. I too was tired of accidentally formatting pages because of CTRL-Dl Thanks, Bruce. – MiGz Sep 11 '12 at 21:04
  • I can confirm that this also works in XE2. There were two of these DLLs that I renamed to *Embarcadero.Modeling.Formatter.dll.renamed* – Jan Doggen Aug 07 '13 at 13:22
2

There is no need for downloading and installing an extension, not even for deleting a file!

In the Delphi 10 Options head to:

Formatting / Delphi / Profiles and Status (the captions may differ slightly, I have translated them from German)

There is a Checkbox there, titled "Activate Formatting".

enter image description here

Possible downside: This Formatter feature is also deactivated in the Edit menu.

LU RD
  • 34,438
  • 5
  • 88
  • 296
David
  • 21
  • 3
  • doesn't work, at least in 10.4.2 it still auto formats the entire file regardless of pressing a shortcut - it does it straight away at file open – T.S Sep 09 '21 at 07:31