Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Tom-Bonnike/vscode-formatting-toggle
A VS Code extension that allows you to toggle the formatter (Prettier, Beautify, …) ON and OFF with a simple click.
https://github.com/Tom-Bonnike/vscode-formatting-toggle
formatter preferences visual-studio-code visual-studio-code-extension
Last synced: about 2 months ago
JSON representation
A VS Code extension that allows you to toggle the formatter (Prettier, Beautify, …) ON and OFF with a simple click.
- Host: GitHub
- URL: https://github.com/Tom-Bonnike/vscode-formatting-toggle
- Owner: Tom-Bonnike
- License: mit
- Created: 2018-01-11T10:51:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-30T17:20:08.000Z (9 months ago)
- Last Synced: 2024-07-31T07:19:05.225Z (5 months ago)
- Topics: formatter, preferences, visual-studio-code, visual-studio-code-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=tombonnike.vscode-status-bar-format-toggle
- Size: 694 KB
- Stars: 59
- Watchers: 1
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome - vscode-formatting-toggle - A VS Code extension that allows you to toggle the formatter (Prettier, Beautify, …) ON and OFF with a simple click. (TypeScript)
README
# 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.
⚠️ Formatting Toggle doesn’t override your workspace settings as these are usually tracked by Git. Consider using ignore configurations (like `.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).
💡 Formatting Toggle was created with formatting settings in mind but allows you to toggle any boolean setting that lives at the root of the VSCode configuration. `editor.codeActionsOnSave` is currently the only deeply nested setting supported.
The status bar text can also be customized via the `formattingToggle.statusBarText` setting. Values for `formattingEnabled` and `formattingDisabled` are distinct, and can include different codicons for each state. See [Product Icon Reference](https://code.visualstudio.com/api/references/icons-in-labels#icon-listing) for all options.
### Examples
#### Keeping `editor.formatOnPaste` and `editor.formatOnType` enabled at all times:
```json
{
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"formattingToggle.affects": ["editor.formatOnSave"]
}
```#### Keeping `editor.formatOnType` disabled at all times:
```json
{
"editor.formatOnType": false,
"formattingToggle.affects": ["editor.formatOnPaste", "editor.formatOnSave"]
}
```#### Allowing `editor.codeActionsOnSave` to be toggled:
```json
{
"formattingToggle.affects": ["editor.codeActionsOnSave.source.fixAll.eslint"]
}
```#### Allowing all formatting settings to to be toggled (default):
```json
{
"formattingToggle.affects": [
"editor.formatOnPaste",
"editor.formatOnSave",
"editor.formatOnType"
]
}
```#### Customizing the status bar text:
```json
{
"formattingToggle.statusBarText": {
"formattingEnabled": "On $(heart-filled)",
"formattingDisabled": "Off $(heart)"
},
}
```