At GDK Software we have been working with Delphi for years. We have collected quite a few tricks and tips, which I would like to share with you. I have organized Delphi’s tips and tricks into the following topics:
As a Delphi developer, you are working with the Delphi IDE on a daily basis. And although the Delphi editor works fine by itself, with the following plugins you can make your work even easier:
GExperts
GExperts adds some very useful features to Delphi, such as Grep Search Alt + Shift + S
, Procedure List Ctrl + G
, Rename Componenten and other very handy shortcuts (see the shortcut section for more).
DDevExtensions
We love DDevExtensions for the Find Unit/Use Unit replacement dialog (Alt + F11
). The default Delphi Use-Unit dialog only shows the files from the project group. DDevExtensions replaces the dialog with one that not only shows the project group files but also all files that the compiler can see. Never again navigate to the uses section and insert a unit by hand, just hit Alt-F11.
DDevExtensions also prevents the IDE from storing the ExplicitWidth and ExplicitHeight properties to the DFM.
Delphi IDE Fix pack
The IDE Fix pack optimizations let the IDE start faster, open projects faster, optimizes the compiler’s file search algorithm, makes CodeInsight, the actual compilation and the debugger faster.
Parnassus Bookmarks
Parnassus Bookmarks replaces the IDE’s inbuilt functionality with new, improved navigation. Bookmarks are saved so that after a restart the bookmarks are still available. Installation can be done via the GetIt package manager.
IDE Shortcuts are the easiest way to speed up development. Most of us undoubtedly know the most important shortcuts in Delphi, but let’s share which ones we use regularly.
(Here you can find all the Delphi shortcuts)
Ctrl + Shift + <Number>
and use it with Ctrl + <Number>
.Ctrl + Shift + Arrow up
or Ctrl + Shift + Arrow down
.Alt + Shift + S
.Ctrl + G
Alt + F11
to add a unit to your code (use with DDevExtensions).Alt + C
. Despite this not being a specific Delphi suggestion, I still want to share this. If you only want to use one of these tips, let it be this one.Other popular shortcuts are::
Ctrl + S
and save all: Ctrl + Shift + S
F9
, compile: Ctrl + F9
and build: Shift + F9
Ctrl + F2
Shift + F11
Ctrl + Shift + C
(i.e. create the methods in the implementation section)Ctrl + Shift + V
Ctrl + Shift + D
(same as V, but instead of the local variable you’ll end up with a class variable)Ctrl + Shift + E
Ctrl + Enter
(when your cursor is on a unit name). Faster than Ctrl + click
, but only works if Delphi can locate the unitCtrl + Alt + Z
(GExperts)Ctrl + Shift + M
Ctrl + Alt + Shift + P
Live Templates (or Code templates, as they were formerly called) are a very useful feature of Delphi. Since Delphi 3 these templates are present in Delphi, but we still see that this handy feature is undervalued. Most developers are familiar with the code completing of if
or while
, where the structure of the statement is created automatically.
But with Live Templates you can automate much more. If you want to see a list of the available Live Templates, you can use the shortcut Ctrl + J.
The more you can automate, the better it is. That’s why it is recommended to create your own live templates for frequently used code within your program. This can easily be done via File -> New -> Other -> Code Template. For more information about the structure of the templates, you can find more information on the wiki of Embarcadero.
Delphi has been around for more than 25 years now. It is therefore impossible to put all possible tips and websites on this page. Below I will list some links to frameworks, tools or code libraries that we at GDK Software regularly use.
Contact
GDK Software UK
(+44) 20 3355 4470GDK Software USA
+1 (575) 733-5744