Big Comments is a Visual Studio Code extension that helps you format large, padded comment blocks around selected text. It's great for making headers, section dividers, or attention-grabbing notes in your code.
I made this to solve my frustration with not being able to easily create clear and consistent "header comments."
- β Wrap selected text in a boxed comment block
- π§ Auto-detects comment style based on file type (e.g.
//,#,--,/* */,<!-- -->) - π§© Supports both single-line and block comments (HTML, CSS, Lua, etc.)
- π¬ Custom symbols + decorators (e.g.
=*,#*,-$) for use with comment colouring extensions - π Auto-resizes box to fit the widest line
- β»οΈ Strips existing comment symbols before re-boxing
- π§± "Big Box" mode: adds extra spacing and padding
- π Inline mode: turn a single line into a full-width comment
- π§· Indent preservation: box aligns with the indentation of the first selected line
- β‘ Fast, keyboard-first UX
Big Comments now supports comment formatting for a wide range of languages:
| Language | Comment Style |
|---|---|
| JavaScript | // |
| TypeScript | // |
| Java | // |
| C / C++ / C# | // |
| Go / Rust | // |
| Scala / Kotlin | // |
| Python / R | # |
| Perl / Ruby | # |
| Shell / Make | # |
| Dockerfile | # |
| SQL / PLSQL | -- |
| HTML / XML | <!-- ... --> |
| CSS / SCSS | /* ... */ |
| Lua | --[[ ... ]] |
If your language isnβt listed, it will fall back to //.
// =======================
// = Initialize database =
// = Run migrations =
// =======================/* =====================
= Initialize styles =
= Add media queries =
===================== */<!-- ======================
= Initialize content =
= Add footer =
====================== -->π‘ Note: For block-style comment formats (like /* */, <!-- -->, --[[ ]]), only the first and last lines use the delimiters. Inner lines are plain, padded text.
//* =======================
//* = Initialize database =
//* = Run migrations =
//* =======================//$ @@@@@@@@@@@@@@@@@@@@@@@
//$ @ Initialize database @
//$ @ Run migrations @
//$ @@@@@@@@@@@@@@@@@@@@@@@// =============================
// = =
// = Initialize database =
// = Run migrations =
// = =
// =============================- Select the text you want to wrap
- Open the Command Palette:
Cmd+Shift+P/Ctrl+Shift+P - Run one of the following commands:
| Command Title | Description |
|---|---|
BigComments: Default Comment Box |
Wraps selected text in a box using = characters |
BigComments: Custom Comment Box |
Prompts for a custom box symbol and optional decorator (e.g., =*, -$) |
BigComments: Big Custom Box |
Adds vertical padding to create a larger, more spaced-out comment box |
BigComments: Inline Comment Box |
Boxes the current line under the cursor |
When prompted:
Enter your desired Box Symbol and (optional) colour decorator (e.g. '=*'):
- The first character is used as the box symbol (e.g.
=) - Any following characters are used as decorator(s) added to the comment symbol (e.g.
//*,//$,##!)
Example:
| Input | Box Symbol | Comment Prefix |
|---|---|---|
=* |
= |
//* |
#$ |
# |
//$ |
@ |
@ |
//@ |
You can add a custom keybinding for any bigcomments command by editing your VS Code keybindings:
- Open Command Palette β
Preferences: Open Keyboard Shortcuts (JSON) - Add a new entry like this:
{
"key": "cmd+shift+b",
"command": "bigcomments.defaultcommentboxinline",
"when": "editorTextFocus"
}This example binds Cmd+Shift+B to run the Inline Comment Box command whenever the editor is focused.
You can replace "cmd+shift+b" with your own preferred key combination, and change the command to any of the following:
| Command | Description |
|---|---|
bigcomments.defaultcommentbox |
Wraps selection in default box |
bigcomments.customcommentbox |
Prompts for custom symbol |
bigcomments.bigcustomcommentbox |
Creates padded βbigβ box |
bigcomments.defaultcommentboxinline |
Boxes the current line under cursor |
Big Comments supports customizable settings in your VS Code settings.json:
| Setting | Type | Default | Description |
|---|---|---|---|
bigcomments.defaultSymbol |
string |
"=" |
The default box symbol used when wrapping text. Used when no custom input is provided. |
To configure it:
- Open Command Palette β
Preferences: Open Settings (JSON) - Add your preferred symbol:
"bigcomments.defaultSymbol": "#"This will use # as the default box symbol when wrapping comments, unless you override it manually via a custom input.
- VS Code 1.85.0 or later
- No external dependencies
- Only one comment style is supported per language
- No unbox/toggle feature yet
- π§· Indent preservation: boxed comments now align to the indent level of the first line in the selection
- π§ Internal improvements to spacing and alignment logic
- π Bug fixes with multicharacter comments
- π Multi-language comment support: now supports single-line and block comment formats for 20+ languages
- π§± Block comment boxes use
/* */,<!-- -->, etc. correctly (only on top and bottom lines) - π§ Improved comment detection and formatting consistency
- π§ Small internal refactors for maintainability
- π‘ Improved custom box prompt: now accepts
symbol + decoratorinput (=*) - β¨ Decorators are applied to the comment symbol (
//*,//#, etc.) - π Small refactor for inline mode, edge cases
- β Added inline mode
- β Added big box mode with padded layout
- π§ Smarter re-parsing of existing comments
- βοΈ Improved default box sizing logic
- Initial release
- Default + custom comment boxes
- Auto language detection (
//vs#)
- Toggle/unbox existing comment blocks
- ASCII banners or emoji box styles
- Global and per-language settings
- Handling multiple comment types in the same language