Files
4ds-devandBurer 201e8b2de3 apps/cedit: menu for managing supported languages, universal language configs (#554)
- all languages are configured via cedit.ini (the “edit” button in the “languages” menu)
- build/run/debug commands are also configured via cedit.ini
- new languages can be added via cedit.ini
- zator language has been added

---------

Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: KolibriOS/kolibrios#554
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Alexey Ryabov <alex@b00bl1k.ru>
Co-authored-by: 4ds-dev <4ds.dev@gmail.com>
2026-08-07 07:57:14 +00:00

249 lines
6.5 KiB
INI

; CEdit config.
;
; [settings] = editor options:
; tab = tab width
; line_spacing = extra px between lines
; blink = cursor blink, ms
; font = 0 small, 1 big
; theme = colours menu index
; line_numbers = 1: show line numbers
; auto_indents = 1: new line keeps indent
; auto_brackets = 1: auto-close ([{
; trim_space = 1: strip trailing spaces on save
; build / run / debug = fallbacks when a language sets none;
; placeholders as in BUILD below
; (toggles are rewritten by the editor itself)
;
; [color_Name] = a colour theme, Name in the menu:
; text / back = main text and background
; seltext / selback = selection
; modified / saved = line change marker
; curline = current line background
; numtext / numback = line-number margin
; comment, string, num, delim, key1, key2, key3 = syntax
; escape = string escapes (default: string colour)
;
; [lang_Name] = a language (Languages menu):
; NAME = menu name (required)
; KW1 / KW2 / KW3 = keyword lists, comma- or space-sep;
; up to 64 words of up to 31 chars, extras are dropped
; delim = delimiter chars for parsing
; COMMENT = line comment prefixes, comma-sep
; SPAN_START / SPAN_END = block markers, comma-sep; up to
; 8 pairs of up to 11 chars, paired by position; first match
; wins, so put the more specific first ({$ before {)
; SPAN_COLOR = colour per pair: comment (default), string,
; key1, key2, key3; name every pair: an empty entry is dropped
; and shifts the rest; this covers ini [sections],
; {$directives}, [[long strings]]
; NEST = 1: spans nest (Oberon, Rust, Haskell, OCaml, D, Swift;
; C, Pascal, Lua do not)
; STRINGS = string-opening quotes ('" or ")
; ESCAPE = 1: colour backslash escapes in strings
; NUMBERS = 1: colour numbers (dec, float, 0x/h-hex, b-bin)
; HEX_PREFIX = extra hex-start char ($ for Pascal $FF)
; CHAR_PREFIX = char-code prefix (# for Pascal #13)
; KEY_COLON = 1: colour ident/string before ':' (json keys)
; EXT = file extensions, comma-sep, no dot (c,h,cpp)
; CASE_SENSITIVE = 1: exact-case keywords (default 0)
; BUILD / RUN / DEBUG = commands for F9 / ctrl-F9 / ctrl-F8;
; %f full path, %e file name, %n name sans ext, %d directory;
; bare "/path/script" opens via assoc,
; "/path/prog args" runs directly
;
; A file matching no EXT opens as Plain text (built-in).
[settings]
tab=4
line_spacing=2
blink=70
line_numbers=1
auto_indents=1
auto_brackets=0
trim_space=1
font=1
theme=0
build=
run=
debug=
[color_Dark]
text=207,208,209
back=31,34,39
seltext=255,255,255
selback=64,67,71
modified=232,232,0
saved=0,208,0
curline=37,40,45
numtext=75,77,81
numback=230,230,230
comment=78,106,135
string=245,238,162
escape=188,112,253
num=237,110,85
delim=255,79,104
key1=255,79,104
key2=188,112,253
key3=188,112,253
[color_Light]
text=0,0,0
back=255,255,255
seltext=255,255,255
selback=0,0,255
modified=232,232,0
saved=0,208,0
curline=255,255,200
numtext=0,0,0
numback=230,230,230
comment=128,0,128
string=0,128,0
escape=0,128,0
num=128,0,0
delim=0,0,128
key1=0,0,128
key2=0,128,128
key3=0,128,128
[color_Tinypad]
text=0,0,0
back=255,255,255
seltext=255,255,255
selback=10,36,106
modified=255,238,98
saved=108,226,108
curline=255,255,255
numtext=0,0,0
numback=221,215,207
comment=128,128,128
string=176,0,0
escape=176,0,0
num=0,144,0
delim=48,48,240
key1=48,48,240
key2=0,128,128
key3=0,128,128
[lang_Ini]
NAME = Ini
EXT = ini
CASE_SENSITIVE = 1
COMMENT = ;,#
STRINGS = "
; a [section] header is just a block span painted key2
SPAN_START = [
SPAN_END = ]
SPAN_COLOR = key2
NUMBERS = 1
KW1 = auto,default,disabled,false,none,true
KW2 =
KW3 =
delim = =
[lang_Fasm]
NAME = Fasm
EXT = asm,inc
COMMENT = ;
STRINGS = '"
NUMBERS = 1
BUILD = /sys/develop/fasm %e,%n,%d/
RUN = /sys/develop/fasm %e,%n,%d/,run
DEBUG = /sys/develop/fasm %e,%n,%d/,dbg
KW1 =
KW2 = byte,word,dword,db,dw,dd
KW3 =
delim = {}[]<>=:,()&*/|+-\#
[lang_JSON]
NAME = JSON
EXT = json
CASE_SENSITIVE = 1
COMMENT = //
SPAN_START = /*
SPAN_END = */
STRINGS = '"
ESCAPE = 1
NUMBERS = 1
KEY_COLON = 1
KW1 =
KW2 = true,false,null
KW3 =
[lang_Oberon]
NAME = Oberon
EXT = ob07
CASE_SENSITIVE = 1
COMMENT = //
SPAN_START = (*
SPAN_END = *)
NEST = 1
STRINGS = '"
NUMBERS = 1
KW1 = ARRAY,BEGIN,BY,CASE,CONST,DIV,DO,ELSE,ELSIF,END,FALSE,FOR,IF,IMPORT,IN,IS,MOD,MODULE,NIL,OF,OR,POINTER,PROCEDURE,RECORD,REPEAT,RETURN,THEN,TO,TRUE,TYPE,UNTIL,VAR,WHILE
KW2 = ABS,ASR,ASSERT,BITS,BOOLEAN,BYTE,CHAR,CHR,COPY,DEC,DISPOSE,EXCL,FLOOR,FLT,INC,INCL,INTEGER,LEN,LENGTH,LSL,LSR,MAX,MIN,NEW,ODD,ORD,PACK,REAL,ROR,SET,UNPK,WCHAR,WCHR
KW3 =
[lang_Pascal]
NAME = Pascal
EXT = pas,pp
COMMENT = //
; {$...} is a compiler directive, not a comment: its pair comes first and is
; painted key3
SPAN_START = {$, {, (*
SPAN_END = }, }, *)
SPAN_COLOR = key3, comment, comment
STRINGS = '
NUMBERS = 1
HEX_PREFIX = $
CHAR_PREFIX = #
KW1 = and,array,begin,case,const,div,do,downto,else,end,file,for,function,goto,if,implementation,in,interface,label,mod,nil,not,of,or,packed,procedure,program,record,repeat,set,shl,shr,string,then,to,type,unit,until,uses,var,while,with,xor
KW2 =
KW3 =
[lang_C]
NAME = C
EXT = c,h,cpp
CASE_SENSITIVE = 1
COMMENT = //
SPAN_START = /*
SPAN_END = */
STRINGS = '"
ESCAPE = 1
NUMBERS = 1
KW1 = auto,break,case,char,const,continue,default,do,double,else,enum,extern,float,for,goto,if,int,long,register,return,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile,while,dword,byte,bool,NULL
KW2 = #define,#error,#include,#elif,#if,#line,#else,#ifdef,#pragma,#endif,#ifndef,#undef
KW3 =
[lang_Lua]
NAME = Lua
EXT = lua
CASE_SENSITIVE = 1
COMMENT = --
; long brackets, one marker pair per level: --[[ comments, then [[ strings
SPAN_START = --[[, --[=[, --[==[, --[===[, [[, [=[, [==[, [===[
SPAN_END = ]], ]=], ]==], ]===], ]], ]=], ]==], ]===]
SPAN_COLOR = comment, comment, comment, comment, string, string, string, string
STRINGS = '"
ESCAPE = 1
NUMBERS = 1
KW1 = and,break,do,end,goto,for,function,in,local,nil,not,or,repeat,return,then,until,while
KW2 = else,elseif,if,false,true
KW3 =
[lang_Zator]
NAME = Zator
EXT = zator
CASE_SENSITIVE = 1
COMMENT = --
SPAN_START = --[[
SPAN_END = ]]
STRINGS = '"
ESCAPE = 1
NUMBERS = 1
KW1 = and,break,do,def,end,goto,generate_img,generate_txt,for,function,in,import,local,nil,not,or,repeat,require,return,then,until,while
KW2 = else,elseif,if,false,true
KW3 =