Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toggle Auto Format On Save with Prettier in VSCode

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

like image 451
avatarhzh Avatar asked Sep 01 '18 05:09

avatarhzh


People also ask

How do I get Prettier to format in save VS Code?

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.

How do I use Prettier auto format?

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.


1 Answers

There is command Save without Formatting with the keybinding Cmd+K S

ref: https://github.com/Microsoft/vscode/issues/38695#issuecomment-423422531

like image 113
ColCh Avatar answered Oct 14 '22 11:10

ColCh