Synta 1.7.0 – 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+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, highlighted current line.
- Alternating row background (context menu > View elements, or AlternateRows=1 in Synta.ini): every second line gets a faint background.
- 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), go to line (Ctrl+G); F4 opens the file in the editor set in Total Commander (as in Lister).
- Zoom with Ctrl+mouse wheel; 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; 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+[ / ] fold and unfold the block around the cursor, Ctrl+Alt+[ / ] all blocks (numpad: Ctrl+- / Ctrl++, with 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.
- 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 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. 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.

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).
