Skip to content
A VS Code extension that allows you to toggle the formatter (Prettier, Beautify, …) ON and OFF with a simple click.
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src
.gitignore
.prettierignore
.vscodeignore
CHANGELOG.md
LICENSE
README.md
icon.png
package-lock.json
package.json
tsconfig.json
vscode-status-bar-format-toggle-2.0.0.vsix

README.md

Formatting Toggle

A VS Code extension that allows you to toggle the formatter (Prettier, Beautify, …) ON and OFF with a simple click.

Installation

In the command palette (CMD + SHIFT + P) select “Install Extension” and choose “Formatting Toggle”.

Usage

The extension should show up on the right side of the status bar. Simply click it to toggle the formatter ON and OFF. Alternatively, in the command palette (CMD + SHIFT + P), run the “Toggle Formatting” command.

Customisation

By default, Formatting Toggle toggles the formatter for all formatting events: formatOnPaste, formatOnSave and formatOnType. To ignore one of these and leave the value that is defined in your settings unchanged, you can use the formattingToggle.affects setting in your editor settings (Code > Preferences > Settings).

Examples

Keeping formatOnPaste and formatOnType enabled at all times:

{
  "editor.formatOnPaste": true,
  "editor.formatOnType": true,
  "formattingToggle.affects": ["formatOnSave"]
}

Keeping formatOnType disabled at all times:

{
  "editor.formatOnType": false,
  "formattingToggle.affects": ["formatOnPaste", "formatOnSave"]
}

Note: this was the default behaviour before version 2.0.0 of the extension.

Allow the formatter to be toggled for all events (default):

{
  "formattingToggle.affects": ["formatOnPaste", "formatOnSave", "formatOnType"]
}
You can’t perform that action at this time.