Next: , Previous: The Key Manager Dialog, Up: Customizing and Extending GPS


16.4 Customizing through XML files

You can customize lots of capabilities in GPS using XML files that are loaded by GPS at start up.

For example, you can add items in the menu and tool bars, as well as defining new key bindings, new languages, new tools, ...

XML files are found through three mechanisms, described here in the order in which they are searched. Files with the .xml extension found through GPS_CUSTOM_PATH or the user's directory can override any setup found in the system directory. Likewise, files found in the user's directory can override any file found in the GPS_CUSTOM_PATH directories.

Note that only files with the .xml or .py extensions are considered, other files are ignored.

XML files must be utf8-encoded by default. In addition, you can specify any specific encoding through the standard <?xml encoding="..." ?> declaration, as in the following example:

     <?xml version="1.0" encoding="iso-8859-1"?>
     <submenu>
       <title>encoded text/title>
     </submenu>

Any given XML file can contain customization for various aspects of GPS, mixing aliases, new languages or menus,... in a single file. This is a convenient way to distribute your plug-ins to other users.

These files must be valid XML files, i.e. must start with the <?xml?> tag, and contain a single root XML node, the name of which is left to your consideration. The general format is therefore

     <?xml version="1.0" ?>
     <root_node>
        ...
     </root_node>

The list of valid XML child nodes that can be specified under <root> is described in later sections. It includes:

<action>
(see Defining Actions)
<key>
(see Binding actions to keys)
<submenu>
(see Adding new menus)
<pref>
(see Preferences support in custom files)
<preference>
(see Preferences support in custom files)
<alias>
(see Defining text aliases)
<language>
(see Adding support for new languages)
<button>
(see Adding tool bar buttons)
<entry>
(see Adding tool bar buttons)
<vsearch-pattern>
(see Defining new search patterns)
<tool>
(see Adding support for new tools)
<filter>
(see Filtering actions)
<contextual>
(see Adding contextual menus)
<case_exceptions>
(see Adding casing exceptions)
<documentation_file>
(see Adding documentation)
<doc_path>
(see Adding documentation)
<stock>
(see Adding stock icons)
<project_attribute>
(see Defining project attributes)
<docgen_backend>
(see Defining a documentation format)
<remote_machine_descriptor>
(see Defining a remote server)
<remote_path_config>
(see Defining a remote path translation)
<remote_connection_config>
(see Defining a remote connection tool)
<rsync_configuration>
(see Configuring rsync usage)