99% of the time I want VSCode to auto format my files on save with Prettier. For that 1% of the time is there a way to toggle this to off in a way that's quicker than going into the settings and then manually switching it on and off?
I've tried looking for any keyboard bindings but the only one I found was prettier.open-output
Automatically Format Document on VS Code Using PrettierOpen the VS Code Settings menu by tapping “Command + ,(comma)” if you use a Mac. Click on “Control + ,(comma)”, if you are a Windows user. Go to the search bar and input “Editor: Format on Save.” Ensure it has a checkmark.
Command+Shift+P to open it. It will show search bar with right arrow >, just start typing Format Document With, and you will come up with results as below. Select Format Document With and again you will be asked for few options. Select Prettier — Code Formatter and your file will be formatted.
There is command Save without Formatting
with the keybinding Cmd+K S
ref: https://github.com/Microsoft/vscode/issues/38695#issuecomment-423422531
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With