Synta 1.18.2 – source code viewer with syntax highlighting (Lister plugin) for Total Commander, 32 and 64 bit

Synta shows source code in Total Commander's Lister (F3) with syntax highlighting, line numbers and an optional minimap. A button shows minified or messy code formatted – the file itself is never changed. Languages and color schemes are plain text files that anyone can extend. Native, no runtime, nothing to install besides the plugin.

Languages
C, C++, C#, Java, JavaScript, TypeScript, Python, PowerShell, Batch, Shell, SQL, Go, Rust, PHP, HTML (with embedded CSS and JavaScript), Astro, XML, CSS, SCSS/Less, JSON, YAML, TOML, INI, Registry files, Total Commander menus (.mnu) and button bars (.bar), Markdown, Diff, Lua, Pascal/Delphi, Visual Basic, Ruby, Kotlin, Swift, AutoHotkey, AutoIt, Makefile, Dockerfile, CMake, EDIFACT, CSV/TSV (every column in its own color) and Synta's own definition files. Files without an extension are recognized by their name (Makefile, Dockerfile) by a #! line or, for Registry exports, by the header; any other text file without an extension is shown as plain text (ExtensionlessText=0 in Synta.ini turns this off).

Features
- Show formatted (Ctrl+Shift+B, icon button next to Word wrap): JSON, XML, HTML, CSS, SQL and C-like languages pretty-printed; only white space changes.
- Word wrap (W), minimap (icon buttons, dimmed while off, with tooltips), line numbers, indent guides (context menu > View elements > Indent guides, or IndentGuides=0), a column line at the cursor (View elements > Cursor column line, or ColumnGuide=1), highlighted current line (always visible, also in light themes).
- Optional search field in the top bar or status bar (View elements > Search field in the toolbar, or Search=1; Search=2 shows only a search button that opens/closes the field, Esc closes it again): Enter = next match, Shift+Enter = previous, Esc = back to the text, wraps around. The ".*" button searches with a regular expression (ECMAScript syntax, line by line, remembered as SearchRegex=1). SearchKey=Ctrl+Shift+F (default) jumps to the field; write F for Ctrl+F, or leave it empty for no shortcut. Ctrl+F stays with Total Commander.
- Occurrence highlighting: select a word and its other occurrences in the file are tinted (whole words when a whole word is selected, parts of words when only part of a word is selected; only the visible lines are searched; View elements > Highlight occurrences, or Occurrences=0).
- Alternating row background (context menu > View elements, or AlternateRows=1 in Synta.ini): every second line gets a faint background; a theme can set its color with tree.tableOddRowsBackground.
- NFO, DIZ and ANS files are shown with tight lines automatically, so ASCII art stays connected (context menu > Line spacing > Always tight for NFO/DIZ, or AutoTight=0; TightExtensions= sets the file types).
- Language picker at the top left, in case a file was recognized wrongly; next to it the encoding picker (UTF-8, UTF-16, Windows and DOS code pages), also in the context menu.
- Select with the mouse (double-click: word, click on a line number: line), copy with Ctrl+C, select all with Ctrl+A.
- URLs (http, https, ftp, www., mailto) are colored as links; Ctrl+click opens one in the default browser or mail program (the pointer turns into a hand while Ctrl is held). In Synta.ini, LinkClick=1 opens links with a plain click and LinkUnderline=1 underlines them. "View elements > Line background (logs)" (or LineBackground=1) additionally tints the whole row of log lines (ERROR, WARN, ...) in the color of their level.
- Search with Total Commander's Find (F7 / F3; it starts at the cursor or the current match, not at the top, and wraps around at the end), go to line (Ctrl+G), jump to the matching bracket (Ctrl+B) or select up to it (Ctrl+Alt+B;matching brackets next to the cursor are highlighted); F4 opens the file in the editor set in Total Commander (as in Lister).
- Zoom with Ctrl+mouse wheel or Ctrl+/Ctrl- (also on the numpad); selectable font and tab width.
- Printing (File > Print): syntax colors on white paper, with line numbers unless PrintLineNumbers=0 is set in Synta.ini; "Wrap text" and "Fit to page" of Total Commander's print settings are respected. With text selected, the print dialog offers "Selection" and prints only that text (with its original line numbers).
- Text cursor (context menu): the arrow keys move it, Shift selects, Ctrl+arrows jump by word; with word wrap, Home and End go to the start and end of the displayed row (WrapHomeEnd=0 in Synta.ini: start and end of the whole line; Ctrl+Home/End: start and end of the file); Home first goes to the first non-blank character of an indented line, a second press to the start of the line (SmartHome=0 in Synta.ini: always to the start); the buttons can sit on top, in the status bar or be hidden (context menu "Buttons", or Buttons=0 hidden, 1 top, 2 status bar in Synta.ini).
- F4 with the cursor position: set EditorArgs= in Synta.ini, e.g. EditorArgs=%1 /GoTo(%LINE%:%COL%) (AkelPad) or EditorArgs="%FILE%:%LINE%:%COL%" (Syntax). With the text cursor on, F4 then starts the editor from Total Commander with these parameters; %1 / %FILE% is the file, %LINE% and %COL% the cursor position (from 1).
- Code folding for every language: chevrons in the gutter (click), Ctrl+Shift+[ / ] (German keyboard: ß / ´; also = / \) fold and unfold the block around the cursor, Ctrl+Alt+ the same keys all blocks, Ctrl+Shift+/ and Ctrl+Alt+/ toggle (numpad: Ctrl+Shift+- / Ctrl+Shift++, with Alt instead of Shift for all), also in the context menu. Blocks come from brackets and indentation (Markdown: headings, INI: sections); FoldCount=1 in Synta.ini shows the number of hidden lines behind the dots, e.g. ... (121 Lines); a language can set Folding=none|braces|indent|headings|sections in its .syntax file.
- Leave file types to other viewers: set ExcludeExtensions= in Synta.ini, e.g. ExcludeExtensions=ts mts (separated by spaces, commas or semicolons). Synta then declines these files and Total Commander uses the next viewer. No change to Total Commander's own ini is needed.
- Light and dark design (automatic like Windows, fixed, or like Total Commander) in the Windows 11 look; color schemes Ayu (Light, Dark, Mirage, Mirage Light), GitHub, Solarized, One, Catppuccin, Gruvbox, Tokyo Night, Rosé Pine and Visual Studio (each in a light and a dark variant).
- Text encodings: UTF-8, UTF-16 (with or without BOM) and legacy code pages (Windows 125x, CP866, CP850, KOI8, Shift-JIS, GBK, Big5, ...), detected automatically and switchable in the context menu (Encoding); DOS text (box drawing characters, umlauts) is recognized as CP437/CP850/CP852/CP866, and NFO, DIZ, ASC and ANS files open as CP437 by default (DetectEncoding=0 turns the guessing off, DefaultCodepage=<number> sets the code page for all other non-UTF-8 files in Synta.ini); files up to 512 MB.
- User interface in English and German (follows the Windows language).

Own languages and color schemes
- Syntaxes\*.syntax: one file per language (keywords, comments, strings, ...). Syntaxes\_template.syntax explains every key. [Beautify] IndentStyle= (space or tab) and IndentSize= (1-16) set the indentation of a language (Go and Makefile use tabs, YAML 2 spaces); they replace TabWidth and CopyIndent for that language, and are used by the Syntax editor too.
- Syntaxes\global.syntax: settings for all languages. Links= lists the URL prefixes (http://, https://, www., mailto:, ...) that are colored as links in text, comments and strings; a language can override or empty the key. LinkEnd= sets the characters that end a URL, LinkAfter= (e.g. href=" src=") starts a link right behind such a prefix. Put your own values into Syntaxes\global.user.syntax (same format, only the keys you change; it overrides global.syntax and an update never touches it). Plain text files (.txt, .log) are shown by Syntaxes\text.syntax.
- Themes\*.json: one file per color scheme, in the VS Code color theme format (the same files Syntax, the editor, uses): "colors" for the editor (editor.selectionForeground sets the text color of the selection, tree.tableOddRowsBackground the alternating rows, editor.selectionHighlightBackground the tint of the other occurrences of a selected word) and "tokenColors" with TextMate scopes for the syntax styles, colors as #RRGGBB or #RRGGBBAA, fontStyle bold / italic. A scope covers its sub-scopes (keyword also colors keyword.control), so theme files from VS Code work. Styles the VS Code scopes have no name for use their own scopes (keyword.control.flow, entity.other.inherited-class, keyword.other.unit, constant.character.escape, constant.character.entity, meta.annotation, entity.name.section, punctuation, markup.changed); if a theme leaves them out, they get the color of the next more general scope. Older Themes\*.theme files (Synta's own format) are still read.
- Context menu → Open "Syntaxes" folder / Open "Themes" folder; "Open Synta.ini in editor" opens the settings file in Total Commander's editor. New or changed files are used for the next file Lister opens; errors are shown in the status bar.
- To add to a built-in language, create Syntaxes\<name>.user.syntax next to <name>.syntax (for example html.user.syntax): only the keys you set replace the original values, while word lists, Extensions=, FileNames= and Shebang= are added to; an update never touches these files. To change a built-in language completely, copy its file and set Priority=1 in the copy – an update replaces the built-in files, not your copy.
- Updating from a version before 1.7: Synta moves your own files from Languages\*.lang to Syntaxes\*.syntax by itself (also *.user.lang), the first time it runs. Nothing to do by hand.

Settings (Synta.ini)
Synta.ini (section [Synta]) is created next to the plugin on first use (if that folder is read-only, next to Total Commander's lsplugin.ini) and lists every key with its default. Context menu > "Open Synta.ini in editor" opens it. Keys marked [ini only] have no menu entry and are changed only in the file; all others can also be changed in the Lister and are written back to the file.
- Theme: 0 automatic (default), 1 light, 2 dark, 3 like Total Commander.
- LightScheme / DarkScheme: color scheme names (default Ayu Light / Ayu Dark).
- Font, FontSize: code font (fixed-pitch only; default Cascadia Mono, 10; decimals allowed, 6-40). Menu: Font...
- TabWidth: 1-16 (default 4). The menu offers 2, 4 and 8; other values only in the ini.
- Wrap, LineNumbers, Formatted, Minimap: 1/0 (defaults 0, 1, 0, 0).
- Buttons: 1 top bar (default), 2 status bar, 0 hidden. An older TopBar=0 becomes 2.
- LineSpacing: extra pixels between lines, 0-40 (default 4). The menu offers 0, 2, 4, 6, 8 and 12; other values only in the ini.
- Cursor: 1/0 (default 1), the text cursor.
- LineBackground, AlternateRows, IndentGuides, ColumnGuide, Occurrences: 1/0 (defaults 0, 0, 1, 0, 1); menu: View elements.
- FoldCount: 1/0 (default 0), number of hidden lines behind the dots of a folded block; menu: Code folding.
- Search: 0 off (default), 1 search field in the toolbar, 2 only a search button. The menu switches between 0 and 1; 2 only in the ini.
- SearchRegex: 1/0 (default 0), toggled by the ".*" button.
- SearchKey [ini only]: Ctrl+Shift+F (default), F for Ctrl+F, empty for no shortcut.
- AutoTight: 1/0 (default 1), no extra line spacing for TightExtensions; menu: Line spacing.
- TightExtensions [ini only]: file types shown tight (default nfo diz ans).
- WrapHomeEnd [ini only]: 1 (default) with word wrap Home / End go to the start / end of the displayed row, 0 of the whole line.
- SmartHome [ini only]: 1 (default) Home goes to the first non-blank character first, 0 always to the start of the line.
- CopyIndent [ini only]: Space (default) or Tab. With Tab, copying from the formatted view writes the indentation as tabs (one tab per tab width of leading spaces).
- EditorArgs [ini only]: parameter template for F4 (%1 or %FILE%, %LINE%, %COL%); empty = just the file.
- ExcludeExtensions [ini only]: file types Synta declines (e.g. ts mts).
- LinkClick [ini only]: 1 a plain click opens a link, 0 (default) Ctrl+click.
- LinkUnderline [ini only]: 1 underlines links (default 0).
- PrintLineNumbers [ini only]: 1/0 (default 1), line numbers in the printout.
- DetectEncoding [ini only]: 1/0 (default 1), guess the code page of files that are not UTF-8.
- DefaultCodepage [ini only]: code page number (default 0 = the Windows code page) for non-UTF-8 files where detection finds nothing better.
- ExtensionlessText [ini only]: 1 (default) shows files without extension as plain text, 0 turns this off.
Lists (ExcludeExtensions, TightExtensions) are separated by spaces, commas or semicolons.

Detect string
Total Commander only offers Synta the files its detect string matches. Synta builds it from the extensions of all Syntaxes\*.syntax files when the plugin is installed (plus files without an extension, which Synta checks itself; .ts and .mts need the MULTIMEDIA term because Total Commander treats them as video). Total Commander allows 2 KB for it; if the extension list gets longer, Synta falls back to "everything except common binary types". To limit Synta to the types you want, edit the string in Configuration → Options → Plugins → Lister plugins → Synta → Configure (or detect= in [ListerPlugins] of wincmd.ini, only with Total Commander closed), for example:
EXT=""|EXT="C"|EXT="H"|EXT="CPP"|EXT="PY"|EXT="JS"|EXT="JSON"|EXT="LANG"|EXT="THEME"|(MULTIMEDIA & (EXT="TS"|EXT="MTS"))

Installation
Open Synta.zip in Total Commander and confirm the installation. Settings are stored in Synta.ini next to the plugin.
JSON and XML are also shown by TreeView (as tree and grid). If both plugins are installed, the one listed first in Configuration → Plugins → Lister plugins opens these files.

Requirements
Total Commander 32 or 64 bit, Windows 10 or 11.

Developer: Ali Naderi – https://digitalent.dev
Freeware: free to use and to pass on unmodified; selling is not allowed.
Color palettes: Ayu by dempfi, GitHub Primer, Solarized by Ethan Schoonover, One (Atom), Catppuccin, Gruvbox by Pavel Pertsev, Tokyo Night by enkia, Rosé Pine, Visual Studio Code (all MIT license).
