Convenient editor shortcuts (Delphi2006)

Posted on Thursday, December 15, 2005 10:11 AM

Every once in a while I'll come across a message from a developer who wasn't aware of a particular feature or keyboard shortcut that might ease some of their development pain.  Following is a short list of convenient editor keyboard shortcuts for the default keybinding that is shipped with Delphi 2006.  This not an exhaustive list, just the ones that I find are lesser known, yet still very convenient.  :-D

CTRL+J               : Invoke code templates
CTRL+T               : Delete current word
CTRL+E               : Incremental search
CTRL+Y               : Delete current line
CTRL+SHIFT+G         : Insert a new GUID at the cursor position
CTRL+SHIFT+I         : Indent the current selected block
CTRL+SHIFT+U         : outdent the current selected block
CTRL+SHIFT+Y         : delete to the end of line
CTRL+SHIFT+J         : Invoke syncedit
ALT+[                : match pair forward
ALT+]                : match pair backward
ALT+RightArrow       : browse forward (hotlink history)
ALT+LeftArrow        : browse backward (hotlink history)
ALT+UpArrow          : browse to symbol under editor cursor (invoke a hotlink and add it to the hotlink history)
F4                   : Run program to current cursor position
F5                   : Toggle breakpoint
F7                   : Debugger step into
F8                   : Debugger step over
F9                   : Run program under debugger
CTRL+F12             : View units
ALT+G                : Goto line number in editor
CTRL+SHIFT+R         : Start/Stop recording editor macro
CTRL+SHIFT+P         : Play editor macro
CTRL+SPACE           : Invoke code completion
CTRL+SHIFT+SPACE     : Invoke code parameter hints
CTRL+ENTER           : Open file at cursor
CTRL+SHIFT+C         : Invoke class completion for the class that currently contains the cursor
CTRL+SHIFT+UpArrow   : Navigate to method implementation/declaration
CTRL+SHIFT+DownArrow : Navigate to method implementation/declaration
CTRL+ALT+UpArrow     : Navigate to previous method implementation in lexical order
CTRL+ALT+DownArrow   : Navigate to next method implementation in lexical order
CTRL+ALT+Home        : Navigate to the lexically first method implementation in this source unit
CTRL+ALT+End         : Navigate to the lexically last method implementation in this source unit
CTRL+/               : Toggle comment per line or selected block

Let me know if anyone wants a list of equivalents in a different keybinding that we provide.

May the editor shortcuts be with you and your coding be swift.

Feedback

# re: Convenient editor shortcuts (Delphi2006)

12/15/2005 1:39 PM by Robert Kozak
Adam,

Why don't you add a window sometime that will display the current keyboard bindings?

-- Robert

# re: Convenient editor shortcuts (Delphi2006)

12/15/2005 2:13 PM by jonjon
Adam,

Is there any shortcut to go to full screen editor mode (hide all palettes) ? I guess that would mean a way to assign a shortcut to a specific desktop configuration. That would be one of the most useful shortcut AFAIC.

# re: Convenient editor shortcuts (Delphi2006)

12/15/2005 2:40 PM by Sebastian Modersohn
Adam,

unfortunately some shortcuts don't work with non-US keyboard layouts (see QC 10967, 10464, 9913 and 1933). This has been the case at least since D6, so it would really be awfull if something about that could be done!

- Sebastian

# re: Convenient editor shortcuts (Delphi2006)

12/15/2005 4:18 PM by Adam Markowitz
Robert,
What I'd like to do is add the functionality so that IDE actions can have user assigned keys.

# re: Convenient editor shortcuts (Delphi2006)

12/15/2005 4:19 PM by Adam Markowitz
Sebastian,
Yes, this has been discussed many times both internally and externally. I'll try to make it a point to have a meeting with International and get their input on this situation.

Thanks.

# re: Convenient editor shortcuts (Delphi2006)

12/15/2005 4:25 PM by Adam Markowitz
jonjon,
Not that I'm aware of. Enter a feature request into QC for that...

Thanks!

# re: Convenient editor shortcuts (Delphi2006)

12/16/2005 4:48 AM by Sebastian Modersohn
Adam,

thanks for keeping an eye on shortcuts working with non-US keyboard!

I realize that this could most easily be solved by user-assignable keybindings (not that it's easyly implemented but it would kill two birds with one stone), but then 3rd party keybinding experts out there would have to be considered as well.

- Sebastian

# re: Convenient editor shortcuts (Delphi2006)

12/16/2005 8:40 AM by Brion L. Webster
I always remember Ctrl-Y as "Yank that line outta here!" - most useful for maintaining someone elses' code... ;-)

# re: Convenient editor shortcuts (Delphi2006)

12/17/2005 2:16 AM by Per Bakkendorff
A shortcut to select a layout configuration is one that I could use.
Or how about attaching different layouts to different editors. aspx triggers one layout, the Together designer triggers another, and so on, just like when we start debugging, the layout selected for Debugging is activated. This is the one my vote goes for.

# re: Convenient editor shortcuts (Delphi2006)

12/17/2005 8:55 AM by Mark Elder
Is there any way to map block indent and outdent to TAB and SHIFT+TAB. CTRL+I and U have always seemed awkward for me. I tried some different keybindins but never seemed to get that one mapped.

# re: Convenient editor shortcuts (Delphi2006)

12/17/2005 9:29 AM by Sebastian Modersohn
Mark,

have a look at the keybindings folder in Demos ToolsAPI . Its not very difficult to write a package that extents the current keybinding and just binds Tab and Shift+Tab for Intendation. If you need more info, post in b.p.d.opentoolsapi.

-Sebastian

# re: Convenient editor shortcuts (Delphi2006)

12/18/2005 8:58 PM by Steve Trefethen
Hey Adam,
Looks like I should get this page updated huh?

http://homepages.borland.com/strefethen/index.php?pagename=Main.KeybindingInformation

-Steve

# re: Convenient editor shortcuts (Delphi2006)

12/18/2005 9:33 PM by Adam Markowitz
Yep. I wish I knew that was there. I like the multiple keymappings table!

# re: Convenient editor shortcuts (Delphi2006)

12/19/2005 9:46 AM by Eber Irigoyen
those are not Delphi 2006 specific, I've been using most of those for as long as I can remember

# re: Convenient editor shortcuts (Delphi2006)

12/19/2005 10:02 PM by Adam Markowitz
Eber,
This is true. Most of them are not Delphi 2006 specific, but there are certainly some in there that are.

-Adam

# re: Convenient editor shortcuts (Delphi2006)

12/31/2005 2:19 AM by javad
Yep. I wish I knew that was there. I like the multiple keymappings table!

# re: Convenient editor shortcuts (Delphi2006)

2/3/2006 3:32 PM by Shawn Oster
What's the shortcut to show a dialog that lists all methods in the current unit with a typeable edit box for searching? :)

Just giving you a hardtime because Visual Studio has something like that and GExperts has provided it with Ctrl-G for a long time. Just a shame since that's the only thing I install GExperts for.

Post Feedback

Title:
Name:
Url:
Comments: 
In our continued efforts to stop comment spammers we ask that you first enter the following code into the box below:
Enter Code Here