Insert perfectly formatted comment separators with one keystroke. Language-aware, configurable, toggleable.
Saturno FancyComments is a VS Code extension that generates consistently formatted single-line and multi-line comment separators. It reads your language's comment syntax automatically and fills to a configurable width. Press once to format, press again to undo.
Maintained by Saturno.Software.
code --install-extension SaturnoSoftware.saturno-fancy-comments- Place cursor on a line (empty or with text)
- Open Command Palette (
Ctrl+Shift+P) - Run
Saturno: Single Line CommentorSaturno: Multi Line Comment
Before:
CONSTANTS
After (Single Line):
// --- CONSTANTS ----------------------------------------------------------
After (Multi Line):
/*
* CONSTANTS
*/
// ------------------------------------------------------------------------
Press the same command again on the formatted line to toggle it back to plain text.
- Single-Line Separators -- 80-char formatted comment with fill characters
- Multi-Line Blocks -- Open/middle/close block with trailing separator
- Toggle/Undo -- Same command strips formatting back to plain text
- Language-Aware -- Reads VS Code's language config (
//,#,<!-- -->, etc.) - Block-Aware -- Multi-line toggle works with cursor on any line of the block
- Configurable -- Line width, fill character, prefix length via VS Code settings
- Zero Config -- Works out of the box with sensible defaults
Search for Saturno FancyComments in the VS Code Extensions sidebar, or install via CLI:
code --install-extension SaturnoSoftware.saturno-fancy-commentscode --install-extension saturno-fancy-comments-2.0.5.vsix- VS Code ^1.88.0
All settings are available in VS Code Settings UI under Saturno FancyComments, or in settings.json:
{
"saturno-fancy-comments.lineWidth": 80,
"saturno-fancy-comments.separatorChar": "-",
"saturno-fancy-comments.separatorPrefixLength": 3
}| Setting | Default | Description |
|---|---|---|
lineWidth |
80 |
Total width of generated comment lines (20-200) |
separatorChar |
"-" |
Character used to fill separator lines (single char) |
separatorPrefixLength |
3 |
Number of separator characters before the text (1-20) |
Default (-, width 80, prefix 3):
// --- Title --------------------------------------------------------------
Stars (*, width 80, prefix 3):
// *** Title **************************************************************
Equals (=, width 120, prefix 5):
// ===== Title =====================================...============================
| Command | Title | Description |
|---|---|---|
saturno-fancy-comments.singleLineComment |
Saturno: Single Line Comment | Format/toggle a single separator line |
saturno-fancy-comments.multiLineComment |
Saturno: Multi Line Comment | Format/toggle a multi-line comment block |
Add to your keybindings.json:
[
{
"key": "ctrl+alt+/",
"command": "saturno-fancy-comments.singleLineComment"
},
{
"key": "ctrl+alt+shift+/",
"command": "saturno-fancy-comments.multiLineComment"
}
]The extension reads VS Code's built-in language configuration files (the same ones used by Toggle Line Comment). It extracts lineComment and blockComment definitions for the active file's language. No manual setup required.
Supported out of the box: C, C++, C#, Java, JavaScript, TypeScript, Python, Ruby, Go, Rust, HTML, CSS, Shell, PowerShell, and any language with a VS Code language extension.
When you run the command on a line that's already a fancy comment, the extension detects the pattern (prefix + separator chars + optional text + fill + suffix) and strips it back to plain text. Detection uses your current separatorChar setting.
For multi-line blocks, the extension searches up to 3 lines backwards from the cursor to find the block start, so toggle works regardless of which line your cursor is on.
npm install
npm test # Compile + run 297 tests
npm run lint # ESLint check
npm run build # Full build + staging
npm run package # Create .vsixContributions welcome! Please:
- Follow existing code style
- Add tests for new features
- Submit pull requests against
main
GPL-3.0 -- See LICENSE.txt for details.
Maintained by Saturno.Software
Q: Does it work with my language?
A: If VS Code can toggle comments in your language, FancyComments will work. It reads the same language configuration.
Q: Can I use * or = instead of -?
A: Yes. Set saturno-fancy-comments.separatorChar to any single character.
Q: Does toggle work if I change the separator char after creating comments?
A: No. Detection uses your current config. Old comments with a different char will be treated as plain text.
Q: Does it work with multi-cursor / selections?
A: It operates on the line where the primary cursor is. Multi-cursor is not currently supported.
Q: How do I install without the Marketplace?
A: Build the .vsix with npm run package, then code --install-extension __DIST/*.vsix.
Made with <3 by Saturno.Software


