Customizing oXygen

Shortcuts

In the rest of this document, we will focus on time-saving tips and hints for working with lexical data in oXygen XML, although most of these tips will apply to other uses of oXygen as well.

Default Shortcuts

Shortcuts are very important because XML is, as you know, quite verbose. The more detailed your encoding is, the more typing you need to do.

  • Surround the selected text with a tag: ⌘-E (Mac) / ctrl-E (Windows):
    This is probably the single most useful and most frequently used shortcut that you will end up using all the time. Because the text remains selected even after the first set of tags have been inserted, the most efficient way of wrapping text with multiple, nested tags is to start from the outer element.

  • surround with last tag used: command + ForwardSlash (Mac) / Ctrl + ForwardSlash (Windows): If you are trying to various selections with the same tag, this will be an even more quicker way of doing it than with ⌘-E / ctrl-E.

Other refactoring shortcuts

By default, oXygen comes with the following refactoring shortcuts:

  • Delete element tags (Alt + X on Mac / Alt + Shift + X on Windows): deletes the start and end tag of the current element. As you have already seen, if you delete a start tag manually, oXygen will delete the end tag as well. But if you like to impress your friends with shortcuts, this is a good one. You don't have to select anything, it's enough for your cursor to be anywhere inside an element whose tags you want to delete.
  • Join elements (Command + Alt + J on Mac / Alt + Shift + J on Windows): joins the left and right elements relative to the current cursor position. The elements must have the same name, attributes, and attributes values.
  • Split element (Ctrl + Alt + D on Mac / Alt + Shift + D on Windows): splits the element from the cursor position into two identical elements. The cursor must be inside the element.

Exercise. Try all of the above shortcuts on your own. If you can't remember them right away, you can always get to them by using the contextual menu (ctrl-click or right-click).

Changing Shortcuts

If the oXygen shortcuts are not to your liking or difficult to remember, you can change them yourself.

Open the preferences, then follow the procedure as shown on the image below:

  1. start typing "shortcuts"
  2. start typing the name of the command whose shortcut you want to change
  3. double-klick the command to get to the shortcut editing window
  4. press the desired shortcut keys to replace the current shortcut
  5. click on OK
  6. click on OK

Global options vs. Project options?

When you make oXygen customizations or transformation and validation scenarios, you can store them globally or bind them to a specific project by choosing the "Project Options" setting in the preferences pages.

It is important to understand the difference between the two.

Global options are stored on your computer and are not accessible to other users (unless you export them into an XML options file, which can then be imported on a different computer). That means that you can use your global customizations in any project which you have on your computer.

Project options, on the other hand, are stored in the currently open .xpr project and available only in the context of the given project. The advantage of project options is that they make it easier for members of the same team to share their customizations: if your project file is saved on a version control system (such as SVN, CVS, or Source Safe) or in a shared folder, then every member of your team will have the same option configuration that you stored in the project file.

TODO: in Starting with Oxygen tutorial, describe the creation of projects.