Nifty TOML
TOML support: highlighting, errors, a formatter that keeps comments, outline, folding, and JSON Schema validation, completion and hover (Cargo.toml, pyproject.toml via SchemaStore). TOML to JSON/YAML.
Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.
Features




- TOML 1.0 language support: syntax highlighting for
.toml files (and Cargo.lock, Pipfile, poetry.lock, uv.lock), comment toggling, bracket matching.
- Syntax errors where they are, with plain messages: a duplicate key, a table defined twice, a table redefined after dotted keys, an inline table extended later, an invalid date, a missing quote. The parser follows the TOML 1.0 spec.
- A formatter that keeps everything: comments (also inside arrays), blank lines (up to a limit), and every string and number exactly as written. It fixes spacing, wraps arrays that are too long (and collapses short ones), and can line up
= and trailing comments. Indentation follows your editor settings (and so .editorconfig). The result is checked to hold the same data, so formatting never changes what the file means.
- Outline and folding of tables, arrays of tables (named by their
name or id), keys, multi-line arrays and strings, and comment blocks.
- JSON Schema validation, completion and hover from SchemaStore:
Cargo.toml, pyproject.toml (Poetry, Ruff, and other tools in [tool.*]), ruff.toml, rustfmt.toml, rust-toolchain.toml, .cargo/config.toml, fly.toml, starship.toml, taplo.toml and 100+ more. Schemas come fresh from the catalog, and the catalog and schemas are cached so files keep working offline.
- Your own schemas with a
#:schema ./schema.json comment at the top of the file (or a root "$schema" = "…" key), or the nifty.toml.schemas setting. Draft-04 to 2020-12 schemas work. The status bar shows which schema a file uses.
- Copy as JSON, Convert to JSON and Convert to YAML (the selection or the whole file). Big integers keep all their digits and dates stay as written.
- Sort Keys in Table (comments move with their entry, blank-line groups stay) and Sort Array for lists like
dependencies = [...].
- Works in the browser on vscode.dev and github.dev.
- Nifty Tools for Rust shows the latest crate versions when you hover dependencies in
Cargo.toml; with it installed, Nifty TOML leaves those hovers to it and adds schema docs everywhere else.
- Nifty Python Envs creates and manages the environments of a
pyproject.toml project; Nifty TOML edits and validates the file itself.
- Nifty JSON Schema validates JSON and YAML files. Nifty TOML uses the same validator, so schemas behave the same in all three.
Commands
| Command |
What it does |
Nifty TOML: Copy as JSON |
Copy the file (or the selection) as JSON |
Nifty TOML: Convert to JSON |
Open the file as JSON beside it |
Nifty TOML: Convert to YAML |
Open the file as YAML beside it |
Nifty TOML: Sort Keys in Table |
Sort the entries of the table at the cursor |
Nifty TOML: Sort Array |
Sort the array of strings or numbers at the cursor |
Nifty TOML: Validate Now |
Check the file and say whether it's valid |
Nifty TOML: Open Schema of This File |
Open the schema the file is checked against |
Nifty TOML: Clear Downloaded Schemas |
Forget downloaded schemas and the catalog |
Settings
| Setting |
Default |
What it does |
nifty.toml.format.alignEntries |
false |
Line up the = of consecutive entries |
nifty.toml.format.alignComments |
true |
Line up comments at the end of consecutive lines |
nifty.toml.format.arrays |
collapse |
collapse arrays that fit on one line, expand them to one item per line, or preserve how they are |
nifty.toml.format.columnWidth |
80 |
Wrap arrays that would make a line longer than this |
nifty.toml.format.trailingComma |
true |
A comma after the last item of multi-line arrays |
nifty.toml.format.indentEntries |
false |
Indent entries under their table header |
nifty.toml.format.indentTables |
false |
Indent sub-tables by their depth |
nifty.toml.format.maxBlankLines |
2 |
At most this many blank lines in a row |
nifty.toml.validate |
true |
Check files against their schema |
nifty.toml.intelliSense |
true |
Hover and completion from the schema |
nifty.toml.schemas |
[] |
Schemas for files: [{ "fileMatch": ["config/*.toml"], "url": "./schemas/app.json" }] |
nifty.toml.schemaStore |
true |
Find schemas for well-known files in the SchemaStore catalog |
nifty.toml.schemaStoreUrl |
SchemaStore |
The catalog to use, e.g. a company mirror |
nifty.toml.network |
true |
Download schemas and the catalog (off: only local and cached ones) |
Nifty TOML becomes the default formatter for TOML files. To keep another one, set "[toml]": { "editor.defaultFormatter": "…" } in your settings.
Install
- VS Code: search for "Nifty TOML" in the Extensions view, or install from the Visual Studio Marketplace.
- Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.
Privacy
This extension collects no telemetry and needs no account. It downloads only the SchemaStore catalog and the schemas your files use (turn that off with nifty.toml.network or nifty.toml.schemaStore).
- Nifty JSON Schema: Validate with Draft 2020-12 & 2019-09: Validate JSON, JSONC and YAML against JSON Schema 2020-12, 2019-09, draft-07, 06 and 04, with precise errors, hover, completion, SchemaStore lookup and schema generation. (Open VSX)
- Nifty XML: XPath, Formatter & XML to JSON: Evaluate XPath with namespaces, copy the XPath of any element, format, minify, check well-formedness and convert XML to JSON. (Open VSX)
- Nifty YAML: Formatter, Validator & Converter: Format YAML without losing comments (Kubernetes-style indents), sort keys, lint with yamllint, copy the key path, and convert to and from JSON. (Open VSX)
- Nifty Markdown: TOC, Lists, Shortcuts & Paste: Markdown editing that keeps up: table of contents, section numbers, smart lists and task toggles, formatting keys, image paste, link checks and completions, and math in the preview. (Open VSX)
- Nifty OpenAPI: Outline, Checks and Try It for API Specs: Edit OpenAPI and Swagger files with an outline, $ref navigation and completion, error checking, example payloads, and Try it requests for your REST client. (Open VSX)
- Nifty Pretty Errors: Readable Error Messages: Readable error messages for every language: TypeScript types formatted as code, long C++ and Rust types folded, and a docs link for every error code, in the hover and a side panel. (Open VSX)
See all 100+ Nifty extensions and web tools at https://getnifty.dev
| |