Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

CudaText files formats

Format of auto-completion acp file

Common auto-completion file format is ANSI text file, it contains list of lines in forms:

pascal
Type Id |Hint
Type Id (Param1; Param2; ...) |Hint
Type Id (Param1; Param2; ...): ResultType |Hint

First line in the file can be the "control" line: it specifies what chars are "word chars" for the used syntax. For example, if word chars are minus, dot, and # sign, the control line should be:

text
#chars .-#

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.

Install.inf supported "os" values

Value of "os" field is comma-separated list of platforms (no spaces around commas). Each platform is supported OS name, with optional trailing "-" and CPU family name.

OS names are:

CPU families are:

So for example Windows x86 platform values are "win" and "win-i386", Linux AMD64 platform values are "linux" and "linux-x86_64".

Install.inf for plugins

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

ini
[info]
title=MyName
desc=Plugin allows smth
type=cudatext-plugin
subdir=cuda_test
homepage=http://github.com/some/name/
api=1.0.200

[item1]
section=commands
caption=MyPlugin\Cmd one
method=run
lexers=CSS,HTML
hotkey=Alt+F

[item2]
section=commands
caption=MyPlugin\-
method=nnnn

[item3]
section=commands
caption=MyPlugin\Cmd other
method=run_more
menu=0

Section names: "item" followed by any string (e.g. "item1"). Fields in sections:

Only for "section=events":

Install.inf sidebar buttons

CudaText can show plugin's sidebar buttons even without running the plugin in "on_start" event. Plugin should add sections "sidebar*" ("*" means any substring), with the keys:

Plugin should add sections "bottombar*" ("*" means any substring) to perform the same, but for the bottom part of sidebar, where buttons "Console" and "Output" are placed.

Install.inf lexer lists

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

ini
[info]
$var=Name1,Name2,Name3

In [itemN] sections set lexers like this:

ini
[itemN]
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:

ini
[info]
$var=regex:.*SQL.*

Install.inf for 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".

ini
[info]
title=NiceDarkTheme
desc=Nice Dark theme (by AuthorName)
type=cudatext-data
subdir=themes

Install.inf for 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.

ini
[info]
title=HTML Smarty
type=lexer
subdir=-

[lexer1]
file=HTML Smarty internal
[lexer2]
file=HTML Smarty
link1=CSS
link2=VBScript
link3=JavaScript
link4=JavaScript
link5=VBScript
link6=PHP
link7=PHP
link8=HTML Smarty internal

Install.inf for lite lexers

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

ini
[info]
title=MyLexer
type=lexer-lite
subdir=-

Format of .cuda-lexops files

Files keep lexer styles, which user changed in the "Lexer Properties" dialog. JSON format.

Root keys:

Color in Pascal format: hex number (6..8 digits) with "$" prefix, or constants. See possible constants (with hex values) in Lazarus file Graphics.pp, where string 'clBlack' is defined. https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/lcl/graphics.pp


From the Free Pascal wiki, page "CudaText files formats", as it stood on 2022-08-16 after a change by Alextp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 4, last changed by WikiArchive .