Formatting Toggle
A VS Code extension that allows you to toggle your formatting settings 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 formatting settings ON and OFF. Alternatively, in the command palette (CMD + SHIFT + P
), run the “Toggle Formatting” command.
.prettierignore
) to ignore specific files for all contributors of your project.
Customization
By default, Formatting Toggle toggles all formatting settings: editor.formatOnPaste
, editor.formatOnSave
and editor.formatOnType
. To toggle different settings, or to prevent a specific setting from being toggled, you can use the formattingToggle.affects
setting in your editor settings (Code › Preferences › Settings).
editor.codeActionsOnSave
is currently the only deeply nested setting supported.
Examples
editor.formatOnPaste
and editor.formatOnType
enabled at all times:
Keeping {
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"formattingToggle.affects": ["editor.formatOnSave"]
}
editor.formatOnType
disabled at all times:
Keeping {
"editor.formatOnType": false,
"formattingToggle.affects": ["editor.formatOnPaste", "editor.formatOnSave"]
}
editor.codeActionsOnSave
to be toggled:
Allowing {
"formattingToggle.affects": ["editor.codeActionsOnSave.source.fixAll.eslint"]
}
Allowing all formatting settings to to be toggled (default):
{
"formattingToggle.affects": [
"editor.formatOnPaste",
"editor.formatOnSave",
"editor.formatOnType"
]
}