Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Spaces Inside BracesNew to Visual Studio Code? Get it now.
Spaces Inside Braces

Spaces Inside Braces

Julian Tu

|
20,743 installs
| (12) | Free
Adds appropriate spacing inside braces
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Spaces Inside Braces

Reformats braces (and others) as you type.

Features

Spaces braces {}, parentheses (), brackets [], and angle brackets <> as you type.

When { is typed to create a pair of curly braces, the following appears with the cursor in between the two braces.

{|}
 ^cursor

Pressing space once by default gives the following:

{ |}
  ^cursor

By installing this extension, it autoformats to:

{ | }
  ^cursor

Removing the space returns the braces to the original state:

{|}
 ^cursor

The extension works with multiple cursors, however all cursors must either be in a position to space or unspace. Otherwise, normal behaviour will be preserved.

Configuration

All options are by default enabled.

  • spaces-inside-braces.enable: enable/disable the extension.
  • spaces-inside-braces.enableForBraces: enable/disable spacing for braces.
  • spaces-inside-braces.enableForParens: enable/disable spacing for parentheses.
  • spaces-inside-braces.enableForBrackets: enable/disable spacing for brackets.
  • spaces-inside-braces.enableForAngle: enable/disable spacing for angle brackets.

Known Behaviour

Pressing delete in the following configuration results in the cursor getting reset.

{|  }
 ^cursor

to

{ | }
  ^cursor

Icon

The icon is from the set "Curly Brackets" by Marek Polakovic from the Noun Project, available at The Noun Project under Creative Commons Attribution 3.0 (CC BY 3.0 US). Full terms at Creative Commons.

The icon was cropped and resized from its original resolution to 128 by 128 pixels.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft