Managing tools in Preferences dialog
Prev | Chapter 3. User-defined tools | Next

## Managing tools in Preferences dialog

To create a new tool or to modify existing ones, open Preferences dialog and select Tools in the list on the left.

Select the tool in the list or click the New button to create a new one. To modify the order in which tools appear in the Tools menu (or in the document context menu), use Up and Down buttons. To rename a tool, click its name in the list to select it and then click again to edit the name. Use the Delete button to delete a tool.

The following controls are available to modify tools:

- `Files` entry specifies for which files the tool is going to be available. It can contain the following:

  - a comma-separated list of file patterns, e.g.

        *.c,*.h

  - a comma-separated list of languages prefixed with "`langs:`", e.g.

        langs: c, c++, objc

  - a regular expression matching document filename prefixed with "`regex:`", e.g. the above pattern list may be written as

        regex:\.[ch]$

  Empty entry means that the tool will be available for all documents.

- `Requires` combo box specifies whether the tool should be enabled depending on current document.

  `Nothing` | the tool is enabled regardless whether there is an open document.
  `Document` | the tool is enabled only if there is an open document. For example, if the tool manipulates current document text, then it needs a document to be there.
  `File on disk` | the tool is enabled only if current document is saved on disk (i.e. it is not "Untitled"). For example, to compile a TeX file, it needs to be saved first.

- `Save` combo box specifies what should be saved every time before the command is executed.

  `Nothing` | nothing will be saved.
  `Current document` | current document will be automatically saved. For example, you probably want to save currrent document before compiling it with latex.
  `All documents` | all open documents will be automatically saved. For example, if the tool builds a C project, then you probably want to save all open files before running make.

- `Type` combo specifies the type of the tool: a Python script, a Lua script, or a shell script.
- Code text field contains script or shell command text. See the section called “Shell scripts”, the section called “Lua scripts”, the section called “Python scripts” for details on what can be here.

Prev | Up | Next
Chapter 3. User-defined tools | Home | Storing tools in files