Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Nifty Format on Save: Toggle, Exclude & ChainsNew to Visual Studio Code? Get it now.
Nifty Format on Save: Toggle, Exclude & Chains

Nifty Format on Save: Toggle, Exclude & Chains

Nifty

| (0) | Free
Control format on save: a status bar toggle, folders and files that are never formatted, time limits, and save chains like organize imports, ESLint fix, then format.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nifty Format on Save

Control format on save: a status bar toggle, folders and files that are never formatted, time limits, and save chains like organize imports, ESLint fix, then format.

Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.

Features

Saving a messy TypeScript file sorts its imports, formats the code, then reports which steps ran

Saving runs organize imports, then format, and reports what ran

The status bar toggle pauses format on save for this workspace

  • One save, several steps, in the order you want. For each language, list what happens on save: organizeImports, any code action such as source.fixAll.eslint or source.fixAll.stylelint, format, or command:<id>. VS Code's own settings can't guarantee that ESLint fixes run before Prettier formats; this can.
  • Leave some files alone. Generated code, vendored libraries, minified files and lock files are never formatted on save, and you can add your own globs or right-click a file and choose Never Format This File.
  • Pause it with one click. The status bar toggle turns format on save off for this workspace only, for when you're editing someone else's code and don't want a 2,000-line diff. Save Without Formatting (Ctrl+K Ctrl+Shift+S) saves just once without it.
  • Saving never hangs. Each step has a time limit (3 seconds by default); a slow formatter is skipped with a note instead of freezing the save.
  • Big files are skipped (over 1 MB by default).
  • What happened? What Happened on the Last Save? tells you which steps ran and how long they took, or why the file was skipped.
  • Works in the browser on vscode.dev and github.dev.

Example

// settings.json
"editor.formatOnSave": false, // Nifty Format on Save takes over
"nifty.format-on-save.chains": {
  "typescript": ["organizeImports", "source.fixAll.eslint", "format"],
  "python": ["source.organizeImports", "format"],
  "*": ["format"]
},
"nifty.format-on-save.exclude": ["**/generated/**", "legacy/**"]

Commands

Command What it does
Nifty Format on Save: Pause/Resume for This Workspace Same as the status bar toggle
Nifty Format on Save: Save Without Formatting Save once without the chain (Ctrl+K Ctrl+Shift+S)
Nifty Format on Save: Run the Save Chain Now Run it without saving
Nifty Format on Save: Never Format This File Add the file to the exclude list
Nifty Format on Save: What Happened on the Last Save? Explain the last save

Settings

Setting Default What it does
nifty.format-on-save.enabled true Run the chain on save
nifty.format-on-save.chains {} Steps per language (* for the rest); without one, files are formatted
nifty.format-on-save.exclude minified, dist, build, vendor, lock files Never format these
nifty.format-on-save.maxFileSizeKB 1024 Skip larger files
nifty.format-on-save.timeoutMs 3000 Skip steps that take longer
nifty.format-on-save.formatOnAutoSave false Also run on auto-save
nifty.format-on-save.showInStatusBar true Show the toggle

Turn off VS Code's editor.formatOnSave (you'll be offered this once) so files aren't formatted twice.

Install

  • VS Code: search for "Nifty Format on Save" 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.

More Nifty tools

  • Nifty Beautify: Format HTML in PHP, Blade & Twig: Format HTML inside PHP, Blade, Twig, Jinja, Handlebars, ERB and Liquid templates without breaking the template tags. (Open VSX)
  • Nifty SQL: SQL Formatter for 20 Dialects: Format SQL in 20 dialects, including dbt and Jinja templates, with your team's settings. (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 JSON: Formatter, Validator & JSONPath: Format, minify, sort keys, query with JSONPath, copy paths, generate TypeScript types, and browse huge JSON files in a fast tree view. (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)
  • Nifty Problems: Project-Wide TypeScript Errors: See TypeScript and ESLint errors for your whole project in the Problems panel, not just open files. (Open VSX)

See all 35 Nifty tools at https://getnifty.dev

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft