[Date Prev][Date Next][Subject Prev][Subject Next][Date Index][Subject Index]

xyscript-ref.txt



Forgot to attach.



XyScript one-line reference  (from reference.pdf)
Slash = synonyms.  [S] = an S-suffixed form opens the picker shown at line end.  (cf. X) =
correlated command.

==================== COMMANDS ====================

? / HELP           Search reference + manual (cf. REF, MAN)
AB                 Abandon buffer; /V asks to save
ABD                Delete file and close buffer
ADDAR file         Merge auto-replace pairs (cf. LOADAR)
ADDKBD name file   Load .kbd into resident slot (cf. KBDMODE)
ADDLIB file        Merge .lib into loaded library (cf. LOADLIB)
ADDSUM             Add number at caret to running total (cf. CLRSUM, PUTSUM)
ANSICOLOR on|off   Color Console output from ANSI codes
APPEND             Append selection to clipboard (cf. PREPEND)
AR                 Auto-replace word behind caret
ATTACH path        Stage attachment for SENDMAIL; bare lists (cf. CLEARATTACH)
AUTOCFG [off]      Live config tracking
AUTOREOPEN on|off  Reload file changed on disk
AUTOSAVE n         Autosave interval, secs; 0 off
BALPAIRS on|off    Matched-bracket highlighting
BALPAIRSCOLOR [S]  Bracket-highlight color   [color-picker]
BC [text]          Blank CMline, optionally put literal text on it
BD                 Backspace (cf. RC)
BEDIT file         Blind edit, invisible buffer (cf. BCLOSE)
BCLOSE [file]      Close blind buffer
BGCOLOR [S] r g b  Editor background color   [color-picker] (cf. FGCOLOR)
BK on|debug|off    Breakpoint
BOTTOM / BF        Bottom of file (cf. TOP)
BREAK              Exit loop (cf. CONTINUE)
BS                 Bottom of screen (cf. HM)
BUFALT             Alternate buffer
BUFGO name|n       Go to buffer
BUFLIST            List buffers (cf. LISTTABS)
BUFNEXT            Next buffer (cf. BUFPREV)
BUFPREV            Previous buffer
BUNDLE [out]       Pack doc + .xymeta sidecar into .xyb (cf. UNBUNDLE)
C1 … C9            Counters: Cn seed sets; bare Cn puts value and advances
CALC [expr]        Calculator; bare evaluates line / sums selection
CALL name args     Call SUB (CALL is optional)
CANCEL             Cancel and close CMline
CAPTURE var cmd    Capture output into var; block form ends ENDCAPTURE / EC
CARETADD [n]       Add caret, multi-caret mode (cf. CARETONE)
CARETALL [pat]     Caret at every match
CARETCOL           Selection → column of carets
CARETDOWN          Caret below each caret (cf. CARETUP)
CARETMOTION logical|visual  Left/Right order in bidi text
CARETNEXT [text]   Add next occurrence (cf. CARETSKIP)
CARETONE           Back to single caret
CARETPOP           Undo last caret change
CARETPRIMARY n     Make caret n primary
CARETSKIP          Skip occurrence
CARETSPLIT         One caret per selected line end
CARETUP            Caret above each caret
CC                 Swap case (cf. LC, UC)
CD path            Change dir (or drive)
CH / CI            Change all; /T top /R regex /P perl /S sel /K keep case /n max (cf. CHA, CV)
CHA / CIA          Change all, case-sensitive
CHARCOUNT          Count characters (cf. WORDCOUNT)
CHECK              One-shot spelling+grammar report (cf. SPELLING, GRAMMAR)
CL / LEFT / PC     Cursor left (cf. CR)
CLEAR var…         Unset variables (cf. SET)
CLEARAR            Empty auto-replace map
CLEARATTACH        Empty attachment list
CLEARCLOSED        Empty reopen list
CLEARKBD           Reset keyboard to built-in
CLERR              Clear $ERROR (cf. SETERR)
CLIP "str"         Set clipboard from string
CLOSEBACK on|off   Closing tab returns to last-visited tab
CLRSUM             Zero running total
CLS / CLEAR        Clear Console
CMBLANK on|off     Blank CMline after each command
CMH ["cmd"]        Stash command in history without running
CMLINE / GH        Focus CMline (cf. GT, TH)
CMPLACE top|bottom|hidden  CMline position
CMCRCOLOR [S]      CMline caret color   [color-picker] (cf. CRCOLOR)
CMCRSHAPE          CMline caret shape (cf. CRSHAPE)
COLORNAMES [filt]  List color names
COMPILE [cmd]      Run build → navigable results tab; /NW new tab (cf. NERR, GJ)
CONTINUE           Next loop iteration
COPY [src dst]     Copy selection to clipboard; or copy file (cf. CUT, PASTE)
CP                 Copy selection to caret (cf. MV)
CR / RIGHT / NC    Cursor right
CRCOLOR [S]        Text caret color   [color-picker]
CRSHAPE bar|block|underline  Text caret shape
CUT                Cut to clipboard
CV                 Change with verify; /n stop after n (cf. CVA)
CVA                Change with verify, case-sensitive
DA                 Insert date and time
DB                 To beginning of selection (cf. DE)
DE                 To end of selection
DECIMALS n|off     Float display places
DEL file           Delete file, confirm (cf. ERNV)
DELMAIL range|all  Delete IMAP messages
DELSEL / DN        Delete selection
DF                 Define: start or close selection (cf. DZ, XD)
DFA                Define all
DIALECT name       English dialect for checker
DIB                Define inside brackets (cf. DIQ)
DIFF [path]        Unified diff: buffer vs disk, or vs path (cf. DJ)
DIMONBLUR on|off   Dim window when unfocused
DIQ                Define inside quotes
DIR / LS [spec]    Directory listing; /W window /H /V pane /O sort /A attr /S recurse /B bare
DIRNW on|off       Listing opens file in new tab
DIRRT on|off       Reuse listing tab
DIRSET switches    Default DIR switches
DIRWCLOSE on|off   DIR/W window closes after open
DIRWNW on|off      DIR/W opens file in new tab
DJ                 Jump from DIFF line to buffer
DL                 Define line
DM                 Extend define to caret
DOCTYPE typst|gfm|html|text|auto  Render kind
DOWN / UP          (see UP)
DP                 Define paragraph; DP+ takes trailing break
DS                 Define sentence; DS+ takes trailing break
DUPVIEW            Second view of file; /W own window
DW                 Define word; DW+ takes trailing break
DWBGCOLOR [S]      DIR/W window background color   [color-picker] (cf. DWFGCOLOR)
DWFAMILY           DIR/W window font family
DWFGCOLOR [S]      DIR/W window text color   [color-picker]
DWFONT [S]         DIR/W window font size   [font-picker]
DWRESET            Clear DIR/W font overrides
DWSCALE            DIR/W window zoom
DWSTYLE            DIR/W window font style
DZ                 Close define
ED / EDIT / OPEN / CA  (see OPEN)
EDFAMILY           Editor font family (cf. EDPROPFAMILY)
EDFONT [S]         Editor font size; +n adjusts   [font-picker]
EDPROPFAMILY       Proportional editor font family (cf. USEFONT)
EDPROPFONTS        Proportional editor font   [font-picker]
EDSTYLE            Editor font style
EI / ENDIF         End IF
ELSE               IF alternative
ELSEIF cond        IF chained test
EMPH [word]        Highlight every occurrence; /R regex; bare clears
EMPHBGCOLOR [S]    EMPH background color   [color-picker] (cf. EMPHFGCOLOR)
EMPHFGCOLOR [S]    EMPH text color   [color-picker]
ENCODING name      Set encoding view; /C convert
END / ER           End of line (cf. HOME)
ENDCAPTURE / EC    End CAPTURE block
ENDFOR / EF        End FOR
ENDSUB / ES        End SUB
ENDSWITCH / ESW    End SWITCH
ENDWHILE / EW      End WHILE
ENTER              Insert newline in doc style
ERNV               Delete file, no confirm (= DEL/NV)
ERRORLOG on|off    Log errors to file
ERRORLOGFILE path  Error-log path
ET                 Insert stopwatch elapsed (cf. ZT)
EXIT / EX          Halt this script (cf. EXITALL)
EXITALL / EX1      Halt all scripts
FGCOLOR [S] r g b  Editor text color; colors selection if defined   [color-picker]
FIND               Find/Replace dialog
FINDBGCOLOR [S]    FIND highlight background   [color-picker] (cf. FINDFGCOLOR)
FINDFGCOLOR [S]    FIND highlight text color   [color-picker]
FOR … EF           FOR i = a TO b [STEP s] | FOR v IN expr | FOR k, v IN expr
FPRINT src [out]   Export unopened file to PDF (cf. TOPDF)
FS                 Full screen: collapse split to this pane (cf. TUS, TZ)
GJ                 Jump from GREP/COMPILE result line
GOFILE / GOF text  Go to tab whose path contains text
GOTO label         Jump to :label
GRAMMAR / GR on|off  Live grammar underlines (cf. SPELLING)
GRAMMARCOLOR [S]   Grammar underline color   [color-picker]
GRAMMARNEXT        Next grammar issue (cf. GRAMMARPREV)
GRAMMARPREV        Previous grammar issue
GRAMMARSTYLE shape Grammar underline shape
GREP pat [path]    Recursive search → results tab; /R /I /W /P; ALLTABS searches
open tabs
GREPAFTER n        Trailing context lines (cf. GREPBEFORE)
GREPBEFORE n       Leading context lines
GREPBLANK 0|1      Blank line between result groups
GT                 Go to text (cf. CMLINE)
HEX on|off         Hex view
HI / HISTORY       Command-history picker
HIGHLIGHT on|off   Syntax highlighting (cf. HLAUTO)
HLAUTO on|off      Auto-highlight recognized files
HLCOLOR [S] kind   Token color; /BG background   [color-picker]
HLKINDS            List token kinds
HLLANG name .ext   Declare highlighter (cf. HLRULE)
HLMODE kind attr   Token attribute: BO IT BI UL BU RV NM
HLRESET            Default highlight theme
HLRULE kind regex  Highlighter rule; /P perl
HM                 Top of screen
HOME / EL          Start of line
IF / IFNOT cond    Conditional … ELSE … EI
IMAPURL url        IMAP server (cf. SMTPURL)
INPUT var [prompt] Read typed line into var (cf. READKEY)
INSERT / WRITE / WR "text"  Insert text (cf. WRITELN, PUT)
JMP n|+n|-n        Jump to char offset
JOBS               List background jobs (cf. KILL, WAIT)
KBCHART            Show keymap chart
KBDDOC [file]      Annotate .kbd with key names
KBDMODE name       Switch to resident layout
KILL id            End background job
LANG [xx|file|off] UI translation
LB                 Start of visual row (cf. LE)
LC                 Lower case (cf. UC)
LD                 Visual row down (cf. LU)
LDSC / LDPM slot   Load script binder &slot (cf. SAVELDSC)
LDTX slot [src]    Load text binder @slot (cf. SAVELDTX)
LE                 End of visual row
LEADING / LSP n    Line spacing %
LEARN word         Add to personal dictionary; /S selection /F file (cf. UNLEARN)
LINTFIX            Fix language issue at caret
LISTLIB            List library routines
LISTMAIL           List IMAP mailbox
LISTSPECIALS       Insert template of all specials
LISTTABS           Modal tab chooser
LISTVARS / LISTVAR List global variables
LL                 Char left, same line (cf. LR)
LNBGCOLOR [S]      Line-number gutter background   [color-picker] (cf. LNFGCOLOR)
LNFGCOLOR [S]      Line-number gutter text color   [color-picker]
LOADAR file        Load auto-replace map, fresh
LOADCFG file       Run config script (cf. SAVECFG)
LOADCLOSED file    Load reopen list (cf. SAVECLOSED)
LOADCM file        Load command history (cf. SAVECM)
LOADKBD file       Load keyboard (cf. SAVEKBD)
LOADLIB file       Load library, replacing (cf. ADDLIB, SAVELIB)
LOADVARS [file]    Restore saved variables (cf. SAVEVARS)
LOCAL var…         Routine-scoped variables
LR                 Char right, same line
LU                 Visual row up
MAILBOX name       IMAP folder, default INBOX
MAILDEBUG on|off   Verbose curl
MAILFROM addr      From: address
MAILPASS secret    Mail password, session only
MAILUSER name      Mail username
MAN [topic]        User manual; topic searches by section
MANPDF             Open manual PDF (cf. REFPDF)
MARKBGCOLOR [S]    Bookmark-gutter background   [color-picker] (cf. MARKFGCOLOR)
MARKCLEAR          Clear bookmark at caret
MARKCLEARALL       Remove all bookmarks
MARKFGCOLOR [S]    Bookmark dot color   [color-picker]
MARKGUTTER off|on|persist  Bookmark gutter display
MARKLIST           Bookmark chooser
MARKNEXT           Next bookmark (cf. MARKPREV)
MARKPREV           Previous bookmark
MARKSET            Set bookmark at caret (cf. MARKCLEAR, MARKTOGGLE)
MARKTOGGLE         Toggle bookmark at caret
MD                 Scroll view down one line, caret fixed (cf. MU)
MDA spec           Mode attribute: color | /B bg color | BO IT BI UL BU RV NM; bare clears
MDALL style pat    MDA every match; /C /R /P /S
MDAS [/B]          Color picker for MDA
MENU ["f"]         Keyboard menu bar
MERGE / ME file    Insert file at caret
MESSAGE [/T:"t"] text  OS-native message box (cf. MSG)
MSG text           Message box; /T:secs toast
MSGBGCOLOR [S]     MSG box background   [color-picker]
MSGHFGCOLOR [S]    MSG header text color   [color-picker]
MSGOKBGCOLOR [S]   MSG OK-button background   [color-picker]
MSGOKFGCOLOR [S]   MSG OK-button text color   [color-picker]
MU                 Scroll view up one line, caret fixed
MV                 Move selection to caret
NE / NEW [file]    New buffer; /H /V split
NERR               Next error location (cf. PERR)
NEWLINE lf|crlf|cr Convert line endings
NL                 Start of next line (cf. PL)
NOP                No-op
NP                 Next paragraph (cf. PP)
NS                 Next sentence (cf. PS)
NW                 Next word (cf. PW)
OF n               Both margins (cf. OFL, OFR)
OFL n              Left margin
OFR n              Right margin
OL / OUTLINE       Heading/routine chooser
OPEN / CA / ED / EDIT path  Open file; /H /V /NV /HEX (cf. NEW, READ)
PABGCOLOR [S]      $CWD-path display background   [color-picker] (cf. PAFGCOLOR)
PAFGCOLOR [S]      $CWD-path display text color   [color-picker]
PANECOLOR [S]      Focused-pane border color   [color-picker]
PAPLACE cmline|status  Where $CWD shows
PASTE              Paste
PATHLEN n          Max $CWD display width
PD                 Page down (cf. PU)
PERR               Previous error location
PICK / CHOOSE var ["t"] list  List chooser into var; /I index (cf. RUNMENU)
PL                 Start of previous line
PP                 Previous paragraph
PR text            Print to status line (cf. PUT)
PREPEND            Prepend selection to clipboard
PREVIEW / PV [on|off]  Live PDF preview pane
PRINT / TOPDF [path]  (see TOPDF)
PRINTEX [file]     Copy doc expanding |…| fields
PS                 Previous sentence
PU                 Page up
PUT text           Insert substituted text at caret
PUTSUM             Insert running total
PVBGCOLOR [S]      Preview pane page color   [color-picker] (cf. PVFGCOLOR)
PVCODE             Preview/PDF code font family
PVCODES            Preview/PDF code font   [font-picker]
PVCODESIZE n       Preview/PDF code font size
PVFAMILY           Preview/PDF body font family
PVFGCOLOR [S]      Preview pane text color   [color-picker]
PVFONTS            Preview/PDF body font   [font-picker]
PVFOOTER template  Page footer; {date} {file} {page} {pages}; | splits L|C|R (cf. PVHEADER)
PVHEADER template  Page header
PVINDENT len       First-line paragraph indent
PVJUSTIFY on|off   Justify body text
PVLEADING len      Line spacing (cf. PVSPACING)
PVMARGIN len       All page margins
PVMARGINB len      Bottom margin
PVMARGINL len      Left margin
PVMARGINR len      Right margin
PVMARGINT len      Top margin
PVMARKS on|off     Render EMPH/URL highlights in PDF
PVPAGENUM pat      Page numbers; off (cf. PVPAGEPOS)
PVPAGEPOS pos      Page-number position
PVPAPER letter|legal|tabloid|a4|a5|a6  Page format
PVSIZE n           Preview/PDF body font size
PVSPACING len      Paragraph spacing
PVWIDTH n          Preview pane width %
PW                 Previous word
QUIET [off]        Suppress messages; /NV also errors
QUIT / QQ          Quit; /NV no prompts
RC                 Rubout char, forward delete
RD                 Rubout define → deletion buffer (cf. UD)
RE                 Rubout to end of line
READ path          Open read-only; /H /V /HEX (cf. RO)
READKEY / RK var [msg]  Read one key; /D description
REC / RECALL       Revert to saved
REDO [n|ALL]       Redo (cf. UNDO)
REF term           Search reference only
REFLOW [n]         Hard-wrap to n columns
REFLOWWIDTH n      Default REFLOW width, 65
REFPDF             Open reference PDF
RELOADLIB          Re-run library loads
REN / RENAME src dst  Rename or move file
REOPEN [n]         Reopen recently closed (cf. CLEARCLOSED)
RETURN [value]     Return from SUB → $RV
RL                 Rubout visual line (cf. RLL)
RLL                Rubout logical line
RO [on|off]        Read-only lock
RP                 Rubout paragraph
RS                 Rubout sentence
RUN file [args]    Run script; /BG /R:var (cf. RUNCODE, RUNHERE)
RUNCODE $var|[xpl] Run XPL text
RUNHERE [args]     Run fenced block at caret
RUNMENU ["t"] list Menu that runs chosen command
RW                 Rubout word
SA / SAVE [file]   Save; /NV (cf. SAAS, ST)
SAAS / SAVEAS [path]  Save as and adopt
SAD file           Save selection to file
SAVEAR file        Save auto-replace map
SAVECFG file       Write config script
SAVECLOSED file    Save reopen list
SAVECM file        Save command history
SAVEKBD file       Dump keyboard
SAVELDSC / SAVELDPM file  Save script binders as script
SAVELDTX file      Save text binders as script
SAVELIB [path]     Write loaded routines to .lib
SAVEMAIL range [path]  Download IMAP messages
SAVEVARS [path]    Save global variables
SCL                Set CapsLock (cf. CCL, TCL = clear, toggle)
SCRATCH            Floating scratchpad; /V prefill from clipboard (cf. SCRATCHCLOSE)
SCRATCHBGCOLOR [S] Scratchpad background   [color-picker] (cf. SCRATCHFGCOLOR)
SCRATCHCLOSE       Close scratchpad; /V insert its text
SCRATCHFGCOLOR [S] Scratchpad text color   [color-picker]
SE                 Search forward; /W /T /R /P /S /X /n (cf. SEB, SEA, SEBA)
SEA                Search forward, case-sensitive
SEB                Search backward
SEBA               Search backward, case-sensitive
SELBGCOLOR [S]     Selection highlight color   [color-picker] (cf. SELFGCOLOR)
SELFGCOLOR [S]     Selected-text color   [color-picker]
SENDMAIL [to ["subj"]]  Send document; /F file /W sync
SEPCOLOR [S]       Separator color   [color-picker]
SESSION on|off     Restore tabs across runs
SET x = expr       Assign; += -= *= /= ^=
SETERR [n]         Set $ERROR
SF                 Save and close all (cf. SL, ST)
SGC                Pop-up CMline on (cf. CGC, TGC = off, toggle)
SH / SHELL [off]   Console tab (cf. SW)
SHELLWIN / SW on|off  Show/hide Console; /H /V
SHOWONETAB on|off  Tab strip for a lone file
SHPROMPT [tpl]     Console prompt template
SL                 Save all modified
SLN                Line numbers on (cf. CLN, TLN = off, toggle)
SMB                Menu bar on (cf. CMB, TMB = off, toggle)
SMTPURL url        SMTP server
SNL                Set NumLock (cf. CNL, TNL = clear, toggle)
SORT               Sort selected lines; /F:n skip /N:n key length
SPELLBIN path      Hunspell executable
SPELLCOLOR [S]     Spelling underline color   [color-picker]
SPELLDICT names    Hunspell dictionaries
SPELLENGINE harper|hunspell  Spelling engine
SPELLING / SP on|off  Live spelling underlines
SPELLNEXT          Next spelling issue (cf. SPELLPREV)
SPELLPREV          Previous spelling issue
SPELLSTYLE shape   Spelling underline shape
SPS                Persistent selection on (cf. CPS, TPS = off, toggle)
SRANDOM seed       Seed RANDOM()
SSL                Set ScrollLock (cf. CSL, TSL = clear, toggle)
ST [path]          Store: save and close tab; /NV
STATUSLINE top|bottom  Status line position
SUB name … ES      Define routine
SUBMIT             Run CMline (cf. XC)
SV var             Save selection into var
SVR                Paragraph marks on (cf. CVR, TVR = off, toggle)
SWITCH expr … ESW  Multi-way branch: CASE v[, v] … DEFAULT
SWS                Whitespace on (cf. CWS, TWS = off, toggle)
TAB [in|out]       Indent / outdent (cf. TB)
TABBGCOLOR [S] state r g b  Tab background by state   [color-picker]
TABINDENT on|off   Auto-indent
TABSPACES on|off   Soft tabs
TABXCOLOR [S]      Tab close-× color   [color-picker]
TB n               Tab width
TEXTFILES .ext,…   Extra Open-dialog text extensions
TH                 Toggle text/CMline focus
THEME light|dark|path  Color scheme
THS [buf]          Split pane stacked (cf. TVS)
TITLEBAR on|off    OS title bar
TOP / TF           Top of file
TOPDF / PRINT [path]  Export PDF (cf. TOSVG, FPRINT)
TOSVG [path]       Export SVG
TRUST 1|0          Allow shell-out
TRV                Swap panes
TUS                Unsplit focused pane
TVS [buf]          Split pane side-by-side
TW                 Next pane
TXT text           Scrollable text dialog; /T:"title"
TXTBGCOLOR [S]     TXT window background   [color-picker] (cf. TXTFGCOLOR)
TXTFAMILY          TXT window font family
TXTFGCOLOR [S]     TXT window text color   [color-picker]
TXTFONT [S]        TXT window font size   [font-picker]
TXTSCALE           TXT window zoom
TXTSTYLE           TXT window font style
TYPEPAIRS on|off   Auto-close typed pairs
TZ                 Toggle pane zoom
UC                 Upper case
UD                 Undelete: paste deletion buffer
UIBGCOLOR [S]      UI chrome background   [color-picker] (cf. UIFGCOLOR)
UIFAMILY           UI font family
UIFGCOLOR [S]      UI chrome text color   [color-picker]
UIFONT [S]         UI font size   [font-picker]
UIRESET            Reset UI sizing
UISCALE            UI zoom
UISTYLE            UI font style
ULSPACES on|off    Underline through spaces
UNBUNDLE file [dir] Split .xyb
UNDO [n|ALL]       Undo
UNDOBEGIN          Open undo group (cf. UNDOEND)
UNDOEND            Close undo group
UNLEARN word       Remove from personal dictionary
UNLOADLIB          Drop user library
UNTITLEDTAB on|off Auto-close blank Untitled tab
GOTOOPEN on|off    Opening already-open file goes to its tab
UP / DOWN          Logical line up / down (cf. LU, LD)
URLBGCOLOR [S]     URL highlight background   [color-picker] (cf. URLFGCOLOR)
URLFGCOLOR [S]     URL highlight text color   [color-picker]
URLHIGHLIGHT on|off  Clickable URLs
USEFONT mono|prop|auto  Per-document font mode
WAIT [ms]          Wait for jobs, or pause ms; /J id
WF / WRITEFILE path content  Write file; /ENC:cs /B /HEX
WHILE cond … EW    Loop
WINGEO on|off      Remember window geometry
WORDCOUNT          Count words
WRAP on|off        Word wrap
WRAPHANG n         Hanging indent for wrapped rows
WRAPINDENT on|off  Hanging indent under line's own indent
WRITELN / WRL "text"  Insert text + newline
WV on|off          Writer's View, no chrome
X cmd              Shell; /NV detached /BG /R:var; X [a; b] chains (cf. XV, XY)
XC                 Execute CMline, keep focus
XD / YD            Cancel define
XSW action         Window: max rest tog mv sz ctr; minall restall togall (Win)
XV var cmd         Shell → variable
XY cmd             Shell → insert output
ZT                 Zero stopwatch

==================== FUNCTIONS ====================

Text:   LEN UPPER LOWER REVERSE STRIP LSTRIP RSTRIP TRIMLEFT(s,n) TRIMRIGHT(s,n)
        SUBSTR(s,i,n) LEFT(s,n) RIGHT(s,n) INDEX(s,sub) CONTAINS(s,sub)
        REPLACE(s,from,to[,n]) CHR(n) ASC(s) FORMAT(tpl,…) EXPAND(s)
Tests:  ISDEC ISHEX ISALPHA ISALNUM ISUPPER ISLOWER ISTITLE ISSPACE ISPRINT
        ISPUNCT ISASCII ISUTF8 ISINT ISFLOAT          (1 or 0)
Split:  SPLIT(s,sep) SPLITS(s,chars) JOIN(arr,sep) CHARS WORDS LINES
Arrays: ITER ITERP PUSH(arr,v) POP(arr) SLICE(arr,a[,b]) SORT(arr[,rev]) VAR(name) SEL([n])
Math:   ABS INT SQRT SQ CUBE POW(b,e) FAC EXP LN LOG BASE(num,from,to) HEX(n[,p])
        SIN COS TAN ASIN ACOS ATAN ATAN2(y,x) SINH COSH TANH ASINH ACOSH ATANH
        PI() E() RANDOM(min,max)
Keys:   KEY(scan) command bound to key   GETKEY(scc) key name
Files:  GETPATH(p)→[dir,name.ext,name,ext] EXISTS ISDIR ISFILE
READFILE/RF(path[,enc])
Date:   DATE(mask) TIME(mask) DATE2JDN(y,m,d) JDN2DATE(jdn[,mask]) DOW(y,m,d)
        DATEDIFF(y1,m1,d1,y2,m2,d2) DATEADD(y,m,d,n[,mask]) TODAY() LEAP(y)
        DAYSINMONTH(y,m) DAYOFYEAR(y,m,d) ISDATE(y,m,d) DATEPARSE(str,mask)
Ops:    + - * / % ^   . concat   == != < > <= >=   AND OR NOT   [arr] {map}   $(expr)

==================== SPECIAL VARIABLES ====================

$1 $2 …            SUB arguments (cf. $*, $#)
$*                 All SUB arguments
$#                 SUB argument count
$ANSICOLOR         Console ANSI color on
$AR                Last LOADAR file
$ATTACH            Staged attachments
$AU                Autosave interval
$AUTOREOPEN        AUTOREOPEN on
$BALPAIRS          Bracket highlighting on
$BALPAIRSCOLOR     Bracket highlight color
$BGCOLOR           Editor background color (cf. $FGCOLOR)
$C1 … $C9          Counter next values
$CALC              Last CALC result
$CAPSLOCK          CapsLock state (cf. $NUMLOCK, $SCROLLLOCK)
$CARETMOTION       logical or visual
$CARETP            Primary caret index (cf. $CARETS, $MCP)
$CARETS            Caret count
$CB                Clipboard (cf. $XB)
$CC                Changes made by last CH
$CF                Last LOADCFG file (cf. $CFA)
$CFA               AUTOCFG tracked file
$CH                Char right of caret
$CL                Last command
$CLOSEBACK         CLOSEBACK on
$CM                CMline contents
$CMBLANK           CMBLANK on
$CMCRCOLOR         CMline caret color
$CMCRSHAPE         CMline caret shape
$CMH               Command history
$CMPLACE           CMline placement
$CP                Caret offset
$CRCOLOR           Caret color
$CRSHAPE           Caret shape
$CS                Caret on selection
$CT                Active tab index (cf. $TC)
$CWD / $PA         Working directory
$CX                Visual column (cf. $CY)
$CY                Visual row
$D1                Buffer is a DIR listing
$DA                Date (cf. $TM)
$DC                Folder separator
$DECIMALS          Float places
$DF                Selection exists
$DIALECT           Checker dialect
$DIMONBLUR         DIMONBLUR on
$DIRNW $DIRRT $DIRSET $DIRWCLOSE $DIRWNW  DIR settings
$DN                Selection end (cf. $DS)
$DOC               Entire buffer text
$DOCTYPE           Render kind
$DP                Listing path + mask
$DR                File under listing caret
$DS                Selection start
$DWBGCOLOR $DWFAMILY $DWFGCOLOR $DWFONT $DWSCALE $DWSTYLE  DIR/W window
$ED                Program path (cf. $XSDIR)
$EDFAMILY $EDFONT $EDSTYLE $EDPROPFAMILY  Editor font
$EMPHBGCOLOR       EMPH background (cf. $EMPHFGCOLOR)
$EMPHFGCOLOR       EMPH text color
$EN                Encoding name
$ERROR             Error code: 0 ok, 1 error, 2 not found, 3 nothing selected, 4 search fail
$ERRORLOG          Error logging on
$ERRORLOGFILE      Error-log path
$ERRORMSG[n]       Error message catalog
$ET                Stopwatch, formatted (cf. $ETS)
$ETS               Stopwatch, seconds
$FB                Caret at file begin (cf. $FE)
$FE                Caret at file end
$FGCOLOR           Editor text color
$FI                File name (cf. $FP)
$FINDBGCOLOR       FIND highlight background (cf. $FINDFGCOLOR)
$FINDFGCOLOR       FIND highlight text color
$FP                Full path
$FS                Buffer bytes
$GC                Pop-up CMline on
$GOTOOPEN          GOTOOPEN on
$GRAMMAR           Grammar underlines on (cf. $SPELLING)
$GRAMMARCOLOR      Grammar underline color
$GRAMMARSTYLE      Grammar underline shape
$GREPAFTER $GREPBEFORE $GREPBLANK  GREP settings
$HEX               Hex view on
$HLAUTO            Auto-highlight on
$HOUR              Hour, 24h (cf. $MIN, $SEC, $MSEC)
$IMAPURL           IMAP server
$INDENTED          Current line indent, columns
$JOBS              Job count (cf. $LJ)
$KB                Last LOADKBD file
$KBDMODE           Active layout slot (cf. $KBDMODES, $XKBDMODE)
$KBDMODES          All resident layout slots
$LANG              UI catalog path
$LC                Caret column, 1-based (cf. $LN)
$LI                Line text
$LJ                Last job id
$LN                Caret line, 1-based
$LNBGCOLOR         Line-number gutter background (cf. $LNFGCOLOR)
$LNFGCOLOR         Line-number gutter text color
$LNS               Line numbers on
$LS                Last status message
$LSP               Line spacing
$MAILBOX           IMAP folder
$MAILDEBUG         Verbose curl on
$MAILFROM          From: address
$MAILPASS          Password set / not set
$MAILUSER          Mail username
$MARK              Caret on bookmark (cf. $MARKS)
$MARKBGCOLOR       Bookmark gutter background (cf. $MARKFGCOLOR)
$MARKFGCOLOR       Bookmark dot color
$MARKGUTTER        Gutter mode
$MARKS             Bookmark count
$MB                Menu bar on
$MCP               Array of caret offsets
$MDAY              Day of month (cf. $MON, $YEAR)
$MIN               Minute
$MO                Modified
$MON               Month
$MSE $MSL $MDF $MDS $MDN $MCS $MCH $MWD $MLI $MLN  Per-caret arrays of $SE $SL $DF $DS $DN $CS $CH
$WD $LI $LN
$MSEC              Millisecond
$MSGBGCOLOR $MSGHFGCOLOR $MSGOKBGCOLOR $MSGOKFGCOLOR  MSG box colors
$NEWLINE           Line-ending name (cf. $NL)
$NL                Line-ending characters
$NUMLOCK           NumLock state
$OF / $OFL         Left margin (cf. $OFR)
$OFR               Right margin
$OS                OS name
$PABGCOLOR         $CWD-path background (cf. $PAFGCOLOR)
$PAFGCOLOR         $CWD-path text color
$PANE              Focused pane position (cf. $PANES)
$PANES             Pane count
$PAPLACE           Where $CWD shows
$PATHLEN           Max $CWD display width
$PS                Persistent selection on
$PV                Preview visible
$PVBGCOLOR $PVCODE $PVCODESIZE $PVFAMILY $PVFGCOLOR $PVFOOTER $PVHEADER $PVINDENT $PVJUSTIFY
$PVLEADING $PVMARGIN[L|R|T|B] $PVMARKS $PVPAGENUM $PVPAGEPOS $PVPAPER $PVSIZE $PVSPACING $PVWIDTH 
Preview/PDF settings
$RC                Last shell exit code (cf. $XO)
$RE / $RO          Read-only
$REFLOWWIDTH       Default REFLOW width
$RUNSUM            Running total
$RV                Last RETURN value
$SC                Last key scan code (cf. $SCC)
$SCC               Scan code + modifier bits
$SCRATCHBGCOLOR    Scratchpad background (cf. $SCRATCHFGCOLOR)
$SCRATCHFGCOLOR    Scratchpad text color
$SCRATCHTEXT       Text of last-closed scratchpad
$SCROLLLOCK        ScrollLock state
$SE                Selected text (cf. $SEL)
$SEC               Second
$SEL               Last selection text, persists
$SELBGCOLOR        Selection highlight color (cf. $SELFGCOLOR)
$SELFGCOLOR        Selected-text color
$SEPCOLOR          Separator color
$SESSION           SESSION on
$SH / $SW          Console visible
$SHOWONETAB        SHOWONETAB on
$SHPROMPT          Console prompt template
$SL                Selected char count
$SMTPURL           SMTP server
$SPELLBIN $SPELLDICT $SPELLENGINE  Spelling engine settings
$SPELLCOLOR        Spelling underline color
$SPELLING          Spelling underlines on
$SPELLSTYLE        Spelling underline shape
$STATUSLINE        Status line position
$TABACTIVE $TABHOVER $TABINACTIVE  Tab colors
$TABINDENT         Auto-indent on
$TABSPACES         Soft tabs on
$TABXCOLOR         Tab close-× color
$TB                Tab width
$TC                Tab count
$TEXTFILES         Extra text extensions
$TITLEBAR          Title bar on
$TL                Total lines
$TM                Time
$TR                Shell-out enabled
$TX                Focus in text; 0 = CMline
$TXTBGCOLOR $TXTFAMILY $TXTFGCOLOR $TXTFONT $TXTSCALE $TXTSTYLE  TXT window
$TYPEPAIRS         Auto-close pairs on
$UIBGCOLOR $UIFAMILY $UIFGCOLOR $UIFONT $UISCALE $UISTYLE  UI chrome
$ULSPACES          ULSPACES on
$UNTITLEDTAB       UNTITLEDTAB on
$URLBGCOLOR        URL highlight background (cf. $URLFGCOLOR)
$URLFGCOLOR        URL highlight text color
$URLHIGHLIGHT      URL highlighting on
$USEFONT           Font mode
$VE                Version
$VR                Paragraph marks on
$WC                Word count
$WD                Word under caret
$WDAY              Weekday, 1 = Sunday (cf. $YDAY)
$WINGEO            WINGEO on
$WRAP              Word wrap on
$WRAPHANG          Hanging indent, spaces
$WRAPINDENT        WRAPINDENT on
$WS                Whitespace on
$WV                Writer's View on
$XB                Deletion buffer
$XKBDMODE          Previous layout slot
$XO                Last shell output
$XSDIR             Program folder
$YDAY              Day of year
$YEAR              Year

==================== LIBRARY ROUTINES (xyscript.lib) ====================

acc                Dead accent: acc, accent key, letter
af                 Fresh throwaway file
alarm h:mm [text]  Alarm with reminder
apfil file         Append selection to file (cf. aptop)
aptop file         Prepend selection to file
arg2 cmd           Line under caret as argument to cmd
awaitdel file      Wait until file disappears (cf. awaitfile)
awaitfile file     Wait until file appears
cal                Month calendar with holidays; $CountryCode
cdd                Dir down one level (cf. cdu)
cdu                Dir up one level
charse str         Search Unicode char names
checkwebupdate     Detect web page change by ETag (cf. getETag)
chkcmnt            Check XPL comments
clone              Second instance, same config
cloned_start_script  Helper for clone
closedn [n]        Regularize blank lines to n (cf. closeup)
closeup [n]        Reduce blank-line runs to n
cmd                Shell session
cmnt [semi]        Toggle comment markers on block
colors [setting n] Adjust color live with arrow keys
d                  cd from saved list; $DirList
ddg [terms]        DuckDuckGo search (cf. ggl)
dellines str       Delete lines containing str (cf. grablines)
dfb cmd            Define to bottom, then run cmd (cf. dft)
dft cmd            Define to top, then run cmd
easter year        Date of Easter
ecp dir            Express copy current file (cf. emv)
emoji              Emoji chart tab
emv dir            Express move current file
fence              Wrap selection in fenced block
fnu                Next URL
getETag            Fetch page ETag
getHolidays-ca     Canadian holidays for cal (cf. getHolidays-us)
getHolidays-us     U.S. holidays for cal
GetIP              Current IP address
ggl [terms]        Google search
go frag…           cd by name fragments
grablines str      List lines containing str
hash               SHA-256 of file → clipboard
idkey              Show what a key does (cf. scancode)
inspect            Adjust Appearance settings
kbd                104-key chart
linecount          Line count
locate             Find files with Locate.exe
log                Timestamped entry atop $Logfile
max n…             Largest (cf. minm)
minm n…            Smallest
nthday             nth weekday of month
num2words n        Number in words
openall spec       Open all matching files
opn                Open file with associated app
panetoggle         Pane ↔ full screen (cf. panezoom)
panezoom           Zoom pane, keep split
pdfedit            Open PDF for editing
pdfread            Open PDF in $PDFreader (cf. pdfread2)
pdfread2           Open PDF in $PDFreader2
ProcExists name    Process running? (Windows)
puts str [n]       Insert string n times; puts U underlines
qd                 Quoted-printable decode block (cf. qe)
qe                 Quoted-printable encode block
renas name         Rename and reopen
sab                Timestamped backup
scancode           Show scan code of a key
sd                 Smart DIR
sef                Search, caret on first char of match
shel cmd           Shell → dialog
siz                Length of selection
togs               Interface toggles menu
typst              Typst docs
U2 [str]           Open xyscript.lib, jump to str
uchar n [- m]      Insert Unicode char, or list range
url                Open URL
uservars           Open user-variables file
v3                 Identify char under caret
values             List internal variables
view               Render to PDF and open
viewimg file [zoom] Image in Preview pane
wipe               Close all tabs, discard
xe                 External editor 1 (cf. xe2, xe3)
xe2                External editor 2
xe3                External editor 3
xysweb             XyScript web page