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-1/tools/
folder.
Names of the files in the tools
folder are used as their menu item
labels, after stripping first three characters, so you can use trhee-character
prefix to affect the order of the menu items, e.g. you can have 00-Do Something
,
01-Another tool
files to have them in that order in the menu. The files
may be of three types:
.py
", they will be used
as Python scripts;.lua
", they will be used
as Lua scripts;
Note that files with .py
and .lua
extensions will be
executed inside medit process; if you want to use them as regular scripts, then just remove the
extension.
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:
|
it can be start or end , and it defines whether the menu item
will be located at the start or at the end of the menu. |
||||||||
|
the tool identificator. | ||||||||
|
the tool name, i.e. the label used in the menu item. Overrides the file name. | ||||||||
|
default keyboard accelerator used to invoke this tool. | ||||||||
|
the menu to place this tool into. By default tools are located in the | menu, but they can be as well put into any other menu.||||||||
|
comma-separated list of languages for which this tool will be enabled. | ||||||||
|
defines for which files this tool will be enabled. The value has the same format as in the Preferences dialog. | ||||||||
|
this corresponds to Requires and Save controls in the Preferences dialog. It is a
comma-separated list of the following:
|
In addition to these, you can set input and output options for executable files (see the section called “Shell scripts” for the meaning of these options):
|
none , lines , selection , or doc . |
|
none , async , pane , insert , or new-doc . |
|
output filter name. |