Skip to content
| Marketplace
Visual Studio Code>Programming Languages>AlignmentNew to Visual Studio Code? Get it now.
Alignment

Alignment

annsk

|
116,009 installs
| (12) | Free
Align code like in Sublime Text 3 Alignment Package
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Alignment

Current Version Install Count Rating

Functionality

This extension align chars in selection. It helps creating clean, formatted code.

usage

Select text and press Alt+= (on macOS Option+=). You can also use context menu commend.

Shortcuts

Align all chars

  • Windows/Linux: Alt+=
  • macOS: Option+=

Align to first char

  • Windows/Linux: Alt+Shift+=
  • macOS: Option+Shift+=

Align whitespace

  • Windows/Linux: Alt+-
  • macOS: Option+-

Extension Settings

This extension contributes the following settings:

  • alignment.chars: pairs chars (strings) and their space settings

Space settings:

  • spaceBefore: spaces count before char(s),
  • spaceAfter: spaces count after char(s),
  • tabsBefore: tabs count before char(s),
  • tabsAfter: tabs count after char(s).

Default settings

// Chars to align
"alignment.chars": {
    ":": {
        "spaceBefore": 0,
        "spaceAfter": 1
    },
    "::": {
        "spaceBefore": 0,
        "spaceAfter": 0
    },
    "=": {
        "spaceBefore": 1,
        "spaceAfter": 1
    },
    "===": {
        "spaceBefore": 1,
        "spaceAfter": 1
    },
    "==": {
        "spaceBefore": 1,
        "spaceAfter": 1
    },
    "=>": {
        "spaceBefore": 1,
        "spaceAfter": 1
    },
    "+=": {
        "spaceBefore": 1,
        "spaceAfter": 1
    },
    "-=": {
        "spaceBefore": 1,
        "spaceAfter": 1
    },
    "*=": {
        "spaceBefore": 1,
        "spaceAfter": 1
    },
    "/=": {
        "spaceBefore": 1,
        "spaceAfter": 1
    }
}

Changelog

0.3.0

  • Aligning whitespace.
  • Align to fist command
  • Extend defaults aligment chars list.
  • Ommit last line of selection if empty.
  • Tabs spacing

0.2.3

  • Changed category to Formatters.

0.2.0

  • Add context menu option.
  • Describe shortcuts in README

0.1.0

  • Fixed alignment to 2 chars string.
  • Alignment many chars in line to table.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft