Page 1 of 1

Custom macros

Posted: Wed Apr 06, 2005 10:16 am
by Zby
Hi,

I know of the Oxygen plugin capabilities but I'd love to have a functionality that could allow Oxygen users to record a sequence of key strokes, store it and assign it to a keyboard shortcut. It's not a big deal, many IDEs have such a functionality. Editing the sequence after recording would be a plus.

Users don't have to be programmers or have installed the Java development environment to write and compile Java programs.
I know that plugin approach is much more flexible and powerful than storing key strokes.
However, for a big number of simple issues, user macros are sufficient. For example, I'd like to define a macro that could insert a custom <figure>...</figure> wrapper into my DocBook files. Or any more complicated custom structure that can used in XML documents.

rgds,
Zby

Posted: Thu Apr 07, 2005 3:33 pm
by george
Hi Zby,

Have a look at the custom templates feature. You should be able to define a template and then easily insert that in the document. A template consistes of a name, a document fragment and the caret position after inserting that and is activated using CTRL+Space after you enter its name (or a prefix of its name). To quickly test that use the XSL editor and enter for instance
cwto
then press CTRL+Space. You should get something like
<xsl:choose>
<xsl:when test="">

</xsl:when>
<xsl:otherwise>

</xsl:otherwise>
</xsl:choose>

You can edit the code templates through the Options->Preferences dialog using the Editor -- Code templates page.

Best Regards,
George

Posted: Mon Apr 11, 2005 9:53 am
by Zby
George,

this is great.
I initially thought that this functionality was only for XSL and XSD files. I've never tried to create a new template.
Now I see this is what I wanted. It's perfect. Thanks.

rgds,
Zby