Better Comment Toggle
approvedby Gino Valente
Improved comment toggling.
Obsidian Better Comment Toggle
Improved comment toggling in Obsidian.
Features
- Easily toggle comments line-by-line or over a selected range of lines
- Configure the start and end tokens for toggled comments
- Change the appearance of commented lines
- Support for both code and math blocks (including custom languages)
- Maintains indentation
Demos





Details
This plugin is purely WYSWIG. That is, there are no hidden HTML tags or other metadata embedded into your notes. The comments exist as you see them in the notes. Any additional styling (e.g. font color) is purely cosmetic and exists only in the editor.
The default comment style is set to HTML (<!-- -->), which is the syntax specified by CommonMark. However, you can configure this plugin to use Obsidian-style comments (%% %%), or even define your own!
Tips
It's recommended to replace the existing keybinding for Obsidian's comment toggling command with the one provided by this plugin:
- ⌘+/ (Mac)
- Ctrl+/ (Windows)
Support
This plugin is totally free to use! I have a lot of fun making stuff like this, so I never expect any type of financial compensation. But if you enjoy the plugin and are feeling generous, I certainly won't say no to a cup of coffee!
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.