VS Aligner is a powerful Visual Studio Code extension that simplifies code alignment and comment formatting. It enhances your coding experience by allowing you to align code comments effortlessly according to your preferred tab size and alignment character.
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Align your comments effortlessly in Visual Studio Code with the VSCode Comment Aligner Extension. This extension allows you to quickly align comments in your code for improved readability and consistency.
Align comments within a selected range in your code.
Automatically detects and aligns comments with different lengths.
Supports single-line comments. (feature update: support multi-line)
Easily customizable to fit your preferred comment alignment style.
Launch Visual Studio Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
Search for "VSCode Comment Aligner" in the Extensions view search box.
Click the Install button to install the extension.
Once installed, you can use the extension to align comments in your code.
Select the lines containing the comments you want to align.
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
Type "VS Align" and select the "VS Align: Align" command.
Your comments will be automatically aligned according to the extension's rules.
You can configure the behavior of the VSCode Comment Aligner Extension by modifying your VSCode settings. To customize the extension's settings, navigate to File > Preferences > Settings and search for "VSCode Comment Aligner."
Here are some available configuration options:
commentAligner.tabSize: Set the number of spaces for alignment (default is 4 spaces).
commentAligner.alignmentChar: Choose the character used for alignment (default is space).