Skip to content

How do you turn off formatting for certain file extensions? #5526

Answered by smhutch
NullVoxPopuli asked this question in Q&A
Discussion options

You must be logged in to vote

We don't support disabling formatting specifically for handlebars files, but there are two approaches you may want to take.

Approach 1: disable auto-formatting

  1. Open the command palette, search for "User settings"
  2. In the settings, search for editor.format
  3. Uncheck "Editor: Format on Save"

Approach 2: disable for HTML files (which also catches handlebars)

  1. Open the command palette, search for "User settings"
  2. In the settings, search for html.format
  3. Uncheck "Enable/disable default HTML formatter."

Alternatively, you may also add a .vscode/settings.json file to your sandbox:

{
  "html.format.enable": false
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@NullVoxPopuli
Comment options

@NullVoxPopuli
Comment options

@smhutch
Comment options

Answer selected by NullVoxPopuli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants