Custom macros

Are you missing a feature? Request its implementation here.
Zby
Posts: 36
Joined: Tue Apr 05, 2005 10:52 am

Custom macros

Post 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
george
Site Admin
Posts: 2096
Joined: Thu Jan 09, 2003 2:58 pm

Post 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
Zby
Posts: 36
Joined: Tue Apr 05, 2005 10:52 am

Post 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
Post Reply