Format of install.inf files

User can open addons in zip files (using "File-Open") and install them.To make such zip file, pack into zip also "install.inf" with meta-info.

  • "title" field (required)
  • "desc" field, long text for install prompt dialog
  • "type" field (required) must be one of:
    • cudatext-plugin: to install plugin to subdir of "py" dir
    • cudatext-data: to copy any files into subdir of "data" dir
    • lexer: to install lexers (zip must be made by SynWrite's ExLexer addon)
    • lexer-lite: to install lite lexer
  • "subdir" field (required)
    • for plugins it should begin with prefix "cuda_"
    • for lexers it should be "-"
  • "homepage" field, source code repository URL (usually on GitHub)
  • "api" field, optional, minimal required API version (3 numbers dot-separated)
  • "os" field, optional, comma-separated list of supported platforms:
    • "win", with optional CPU suffix
    • "linux", with optional CPU suffix
    • "macos"
    • "freebsd", with optional CPU suffix
    • "openbsd", with optional CPU suffix
    • "netbsd", with optional CPU suffix
    • "dragonfly", with optional CPU suffix
    • "solaris", with optional CPU suffix

CPU suffix is "-" char followed by names: i386, x86_64, arm, aarch64, sparc. So for example Linux/x86 allows values "linux" and "linux-i386", Solaris/AMD64 allows values "solaris" and "solaris-x86_64".

Plugins

Example of install.inf for plugin (plugin adds 2 menu items with menu separator between):

  1. [info]
  2. title=MyName
  3. desc=Plugin allows smth
  4. type=cudatext-plugin
  5. subdir=cuda_test
  6. homepage=http://github.com/some/name/
  7. api=1.0.200
  1. [item1]
  2. section=commands
  3. caption=MyPlugin\Cmd one
  4. method=run
  5. lexers=CSS,HTML
  6. hotkey=Alt+F
  1. [item2]
  2. section=commands
  3. caption=MyPlugin\-
  4. method=nnnn
  1. [item3]
  2. section=commands
  3. caption=MyPlugin\Cmd other
  4. method=run_more
  5. menu=0

Section names: from "item1" to "item400", any numbers can be skipped. Fields in "item" sections:

  • "section": possible values are "commands", "events".
  • "caption": caption of menu item in Plugins menu. "\" separates menu levels. "&" makes accelerator hotkey. "-" as final level name, makes separator menu item.
  • "method": Python method name in Command class.
  • "lexers": comma-separated lexer names, means that command can be run only when such lexer(s) active.
  • "hotkey": value must be simple hotkey string (e.g. "Alt+F", "Ctrl+Shift+F1") or key combo separated by "|" (e.g. "Alt+F|F|G").
    • If "lexers=" param missed, then hotkey saves to file "keys.json" for all lexers.
    • If "lexers=" param present, then hotkey saves to "keys lexer NNNN.json" for each mentioned lexer.
  • "menu": optional. Possible values:
    • "" (empty, default): menu item will be put to "Plugins".
    • "0": hide menu item.
    • "o": menu item will be put to "Options / Settings-plugins".
    • "op": menu item will be put both to "Plugins" and "Options / Settings-plugins".

Only for "section=events":

  • "events": comma-separated list of events to handle in plugin, e.g. "events=on_change,on_caret".
  • "keys": only for plugin which handles "on_key": comma-separated list of int key codes to handle in "on_key", e.g. "keys=9" means that "on_key" is only called for key code 9 (tab char).

Plugin can show sidebar button(s), without running plugin code. For this, add sections "sidebar1" to "sidebar3", with keys:

  • "hint": hint of button, must be the same as used by plugin to create button in runtime.
  • "icon": filename of PNG icon. If path missed, used file from CudaText. To use path in plugin dir, write value as "{dir}/subdir/filename.png" - with macro, with / slashes.
  • "method": Python method name to show plugin side panel. This command must create side panel for this sidebar button.

Lexer lists

If plugin has many [itemN] sections, it is possible to set list of lexers using vairable (not to write each time "lexers=name,name2,name3"). Declare list of lexers in [info] section like this, any variable name:

  1. [info]
  2. $var=Name1,Name2,Name3

In [itemN] sections set lexers like this:

  1. [itemN]
  2. lexers=$var

You can set lexers by reg-ex, e.g. reg-ex ".SQL." means all names with substring "SQL". To do it, write variable with prefix:

  1. [info]
  2. $var=regex:.*SQL.*

Data-files

Example of install.inf for data files, to be copied into subdir of "data" dir. Name of subdir can be any, for example "themes".

  1. [info]
  2. title=NiceDarkTheme
  3. desc=Nice Dark theme (by AuthorName)
  4. type=cudatext-data
  5. subdir=themes

Lexers

To see example of install.inf for lexers, download any lexer. To see complex example, download lexer zip for "HTML Smarty" which has 2 lexers inside, one lexer is linked to another.

  1. [info]
  2. title=HTML Smarty
  3. type=lexer
  4. subdir=-
  1. [lexer1]
  2. file=HTML Smarty internal
  3. [lexer2]
  4. file=HTML Smarty
  5. link1=CSS
  6. link2=VBScript
  7. link3=JavaScript
  8. link4=JavaScript
  9. link5=VBScript
  10. link6=PHP
  11. link7=PHP
  12. link8=HTML Smarty internal

Lite lexers

Example of install.inf for lite lexer. Note that "^" suffix not needed here.

  1. [info]
  2. title=MyLexer
  3. type=lexer-lite
  4. subdir=-