Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Auto Comment Next LineNew to Visual Studio Code? Get it now.
Auto Comment Next Line

Auto Comment Next Line

ctf0

|
3,122 installs
| (6) | Free
auto comment next line when pressing enter
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

i've tried every possible ext that add this feature but sadly all have its own issues, so without any hacks or workarounds, here's what we do

  • check if pressed key is "enter".
  • check if previous line started with a comment char.
  • execute the editor.action.commentLine command.

Config

  • single line comment chars list
    • until https://github.com/microsoft/vscode/issues/580 is solved, we have to use the manual way :disappointed:
"auto-comment-next-line.list": [
     {
        "char": "//",
        "languages": [
            "php",
            "javascript",
            "jsonc"
        ]
    },
    {
        "char": "#",
        "languages": [
            "python"
        ]
    }
]
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft