Fun Delphi 2007 Features: Live Templates
Introduced in Delphi 2006, Live Templates are like “RAD for writing code” by providing dynamic “live“ macros that guide you thru code structures. They can autofill elements and iterations, and they can even wrap themselves around and act on selected code. Hot key invokable, there are many Live Templates included in Delphi 2007. Under the hood, they are simple scriptable XML files but they are very powerful, they can query the compiler, invoke refactorings, and just about anything you can think of. So you can use the included templates or you can write your own code templates that can do all kinds of crazy things you might think of at 2am on too much coffee. There is even a template to guide you thru building templates
The templates are all hotkey invokable with Ctrl-J and they are also editable (just right click on them from the Templates View and select Edit) or can be used as samples to learn how to build new custom templates. Here is a list of all the Live Templates included in Delphi 2007:

Share This | Email this page to a friend
Posted by Michael Swindell on May 18th, 2007 under Uncategorized |7 Responses to “Fun Delphi 2007 Features: Live Templates”
Leave a Comment
You must be logged in to post a comment.
Server Response from: dnrh2.codegear.com

RSS Feed
May 19th, 2007 at 8:40 pm
Good demo. But it is too fast to understand what and how Love Templates do.
May 20th, 2007 at 4:16 pm
While I love the templates and find them very useful, documentation on how to make them is almost non-existant (in Dephi 2007 help for just about anything either doesn’t exist or is so burried that I only use it as a last resort. I hope improved ones are in the works). I was able to work my way through creating one but only with the help of a few web sites. Is there any formal documentation on templates?
May 20th, 2007 at 4:17 pm
Hi, this is very slick - I am new to delphi - any suggestions on get into delphi quickly, former xbase programmer…. feel out of place with it and connecting to databases has been a nightmare…
May 21st, 2007 at 8:22 am
Very good demo:-) What always impresses me the most with Live Template is the support for enumerated types in a "case" statement.
May 25th, 2007 at 10:37 am
Will be nice if it would include more templates for many other like message boxes, dialogs, open files routines, database programming tasks, etc, etc, etc…, maybe like in a tree like manner with categories based on the task you need to accomplish, I know I can added them but for a novice like me and many others new to Delphi it would be nice if it just came with them right out of the box. You guys are doing an excellent job, thanks.
July 17th, 2007 at 12:10 pm
I would like to create the following template:
Wrap the code at the END of the line
with Begin End (Not selecting it).
BE SomeCodeHere();
begin
SomeCodeHere();|*|
end;
But I cannot find a way to get the EOL
to go there. I always get:
begin
|*|
end;SomeCodeHere();
I need some kind of CutToEOL() and
Paste();
Is there a way?
Thanks.
Kirk Out!
August 14th, 2008 at 10:46 am
Better Look; Easy Declaration.