
A VS Code extension to quickly insert stylish ASCII or markdown-style comment banners for code and documentation. Perfect for organizing large files and creating clear section headings.
Features
- Centered Banners: Automatically centers your text using box-drawing characters.
- Language Aware: Detects the file language to use the correct comment prefix (
//, #, --, %, etc.).
- Smart Wrapping: Automatically wraps text to multiple lines if it exceeds the set width.
- Extensive Support: Now supports Lean, Rust, Haskell, SQL, and many more.
- Customizable: Change the banner width or add custom prefixes in the settings.
- Quick Shortcut: Use
Ctrl + Alt + B (Windows/Linux) or Ctrl + Option + B (macOS).
Banner Styles
Supports multiple styles including:
Double-line, Rounded, Thick, Single-line, Dashed, Classic, Equals, Arrow, Unicode Block, and Fidget.
Supported Languages
Automatically detects comment syntax for:
- C-Style: JS/TS, Rust, C/C++, Java, Go, Swift, C#, etc. (
//)
- Hash-Style: Python, Ruby, Shell, YAML, Dockerfile, etc. (
#)
- Dash-Style: Lean, Haskell, SQL, Lua, Ada, etc. (
--)
- Percent-Style: LaTeX, Erlang, Matlab (
%)
- Others: Lisp (
;;), Fortran (!), Assembly (;)
Usage
- Select text or place the cursor where you want the banner.
- Open the Command Palette (
Ctrl+Shift+P).
- Type: Banner: Insert ASCII Box.
- Choose your preferred style.
- Done!
Extension Settings
This extension contributes the following settings:
commentBanners.width: Set the total width of the banner (default is 60).
commentBanners.customPrefixes: Define custom comment characters for specific language IDs.
Installation
Search for Comment Banners in the Extensions Marketplace or install via CLI:
code --install-extension naela.comment-banners
| |