Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Fold Single-Line CommentsNew to Visual Studio Code? Get it now.
Fold Single-Line Comments

Fold Single-Line Comments

teamleaderleo

|
68 installs
| (0) | Free
Fold consecutive single-line comments in Python, Ruby, Shell scripts, and YAML files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Fold Single-Line Comments

Adds folding support for consecutive single-line comments in languages that use # for comments.

Supported Languages

  • Python
  • Ruby
  • Shell scripts
  • YAML

Features

  • Adds folding markers for consecutive single-line comments
  • Works with the standard VSCode folding controls
  • Supports comments at any indentation level

Usage

Once installed, you'll see folding markers next to consecutive comment blocks in supported files. You can:

  • Click the folding marker in the gutter to fold/unfold
  • Use standard VSCode folding shortcuts
  • Use the command "Fold Single-Line Comments" from the command palette

Background

This extension was created to address a long-standing feature request for Python comment folding support in VSCode from 2022. We've extended the functionality to other languages that use similar comment syntax.

Issues and Contributions

Found a bug or want to suggest a feature? Visit our GitHub repository.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft