2.2. Storing tools in files

It is possible to create tools without using the Preferences dialog, they can be stored in files in tools subfolder of the medit data folders (or tools-context for tools which appear in the document context menu). In particular, on Unix systems you can place files into $HOME/.local/share/medit/tools/ folder.

Names of the files in the tools folder are used as their menu item labels, after stripping first two characters, so you can use two-character prefix to affect the order of the menu items, e.g. you can have 00Do Something, 01Another tool files to have them in that order in the menu. The files may be of three types: files with extension ".py", they will be used as Python scripts; files with extension ".lua", they will be used as Lua scripts; and executable files, they will be executed in the same way as shell commands.

To set parameters for a tool, place them on the first or the second line of the file in the following format:

!! key=value; key=value; ... !!

key may be one of the following:

In addition to these, you can set input and output options for executable files: