TOML language support for Visual Studio Code — syntax highlighting, language configuration, snippets, and an opt-in file icon. Built with vsceasy.
- Syntax highlighting for
.tomlfiles (andCargo.lock,poetry.lock,uv.lock,Pipfile,Gopkg.lock): tables[x], array-of-tables[[x]], bare & quoted keys, basic / literal / multiline strings, integers (dec, hex, octal, binary), floats, booleans, RFC 3339 dates & times, arrays, inline tables, and#comments. - Language configuration —
#line-comment toggling, bracket matching and auto-closing for[],{},",', and# region/# endregionfolding. - Snippets —
table,tablearray,kv,kvstr,array,inline,kvbool. - File icon (opt-in) — a
TOML Iconsfile-icon theme. - Color theme (opt-in) — a
TOML Darktheme that emphasizes each section.
The grammar uses standard TextMate scopes, so your current theme already colors TOML. Two ways to make sections stand out more:
Option A — keep your theme, recolor only TOML. Add this to your
settings.json (Preferences: Open User Settings (JSON)). It scopes to
source.toml, so nothing else changes:
Option B — use the bundled theme. Preferences: Color Theme → TOML Dark.
This replaces your whole editor theme (not just .toml), so prefer Option A if
you only want TOML to pop.
VS Code file icons come from an icon theme, which is global: activating one
replaces all file icons in the workbench, not just .toml. This extension
ships a TOML Icons theme but does not force it. To enable it, run
Preferences: File Icon Theme and pick TOML Icons. Highlighting, language
config and snippets work whether or not you enable the icon theme.
From a packaged .vsix:
code --install-extension vscode-toml-support-*.vsixThis extension is a vsceasy
project scaffolded with vsceasy create --type language.
bun install
bun run gen # sync package.json#contributes from contributes.extra.json
bun run launch # build + open an Extension Development HostOpen a .toml file in the dev host to see highlighting. Edit the language
support directly:
| File | What it controls |
|---|---|
syntaxes/toml.tmLanguage.json |
TextMate grammar (highlighting) |
language-configuration.json |
comments, brackets, folding |
snippets/toml.json |
snippets |
fileicons/toml-icon-theme.json + icons/toml.svg |
file icon theme |
contributes.extra.json |
wires the above into package.json#contributes |
scripts/gen.ts regenerates the parts of package.json#contributes it owns and
deep-merges contributes.extra.json for the language contributions — so re-run
bun run gen after editing contributes.extra.json.
bun run package builds a .vsix. To publish to the VS Code Marketplace you
will also need a 128×128 PNG icon field in package.json and an unscoped
name/publisher registered with the Marketplace (vsce rejects scoped
package names).