A powerful Sublime Text plugin for creating more readable and organized comments throughout your code. Colored Comments allows you to highlight different types of comments with custom colors, search across your entire project for tagged comments, and maintain code documentation standards.
The plugin was heavily inspired by Better Comments by aaron-bond but has been completely rewritten with modern async architecture and enhanced functionality.
- π¨ Colorful Comment Highlighting - Automatically highlight comments based on configurable tags
- π Project-wide Tag Search - Quickly find all TODO, FIXME, and custom tags across your entire project
- β‘ Async Performance - Non-blocking file scanning with optimized batch processing
- π― Smart Preview - Preview tag locations without losing your current position
- π Enhanced Quick Panel - Rich HTML formatting with emojis and file context
- βοΈ Fully Configurable - Customize everything from tags to file scanning behavior
- π Continuation Support - Continue highlighting across multiple comment lines
- π Modern Architecture - Built with async/await and optimized for large projects
- Install the plugin via Package Control
- Add comment tags to your code:
# TODO: Implement user authentication # FIXME: Fix memory leak in data processing # ! Important: This affects security # ? Question: Should we cache this result?
- Use
Ctrl+Shift+P
β "Colored Comments: List All Tags" to search your project - Customize tags and colors in your settings
Command | Description | Default Keybinding |
---|---|---|
Colored Comments: GoTo Comment |
Command to list tag indicated comments across entire project | - |
Colored Comments: List All Tags |
Similar to GoTo Comment, but limited to specific tags | - |
Colored Comments: Edit Color Scheme |
Open color scheme editor with template | - |
Colored Comments: Show Debug Logs |
View debug information | - |
Configure the plugin by editing Preferences
β Package Settings
β Colored Comments
β Settings
:
When enabled, comments can span multiple lines with continuation:
# TODO: Implement user authentication system
# - Check password strength requirements
# - Add two-factor authentication support
# - Integrate with OAuth providers
# This comment won't be highlighted (no continuation marker)
Control which files are scanned during project-wide tag searches:
{
// File extensions to skip when scanning for tags
"skip_extensions": [
".pyc", ".class", ".exe", ".dll", ".zip", ".jpg", ".mp4", ".pdf"
],
// Directory names to skip when scanning
"skip_dirs": [
"__pycache__", ".git", "node_modules", ".vscode", "build", "dist"
]
}
The plugin comes with these default tags:
Tag | Identifier | Description | Emoji |
---|---|---|---|
TODO | TODO:? or todo:? |
Tasks to be completed | π |
FIXME | FIXME:? or fixme:? |
Code that needs fixing | π§ |
Important | ! |
Critical information | |
Question | ? |
Questions or uncertainties | β |
Deprecated | * |
Deprecated code | |
UNDEFINED | //:? |
Placeholder comments | β |
Add your own tags or override defaults:
{
"tags": {
"NOTE": {
"scope": "comments.note",
"identifier": "NOTE[:]?|note[:]?",
"is_regex": true,
"ignorecase": true,
"icon_emoji": "π"
},
"HACK": {
"scope": "comments.hack",
"identifier": "HACK[:]?|hack[:]?",
"is_regex": true,
"icon_emoji": "π¨",
"outline": true
}
}
}
Each tag supports these properties:
identifier
- Text or regex pattern to match (required)is_regex
- Set totrue
if identifier is a regex patternignorecase
- Case-insensitive matchingscope
- Color scheme scope nameicon_emoji
- Emoji shown in quick panel and previewsunderline
- Enable solid underlinestippled_underline
- Enable stippled underlinesquiggly_underline
- Enable squiggly underlineoutline
- Enable outline only (no background fill)priority
- Matching priority (lower numbers = higher priority)
{
"tags": {
// Simple plaintext tag
"BUG": {
"identifier": "BUG:",
"scope": "comments.bug",
"icon_emoji": "π"
},
// Regex tag with high priority
"CRITICAL": {
"identifier": "CRITICAL[!]*:?",
"is_regex": true,
"priority": -1,
"scope": "comments.critical",
"icon_emoji": "π¨",
"outline": true,
"underline": true
},
// Case-sensitive tag
"API": {
"identifier": "API:",
"ignorecase": false,
"scope": "comments.api",
"icon_emoji": "π"
}
}
}
When you use "Edit Color Scheme", the plugin automatically injects comment color definitions:
{
"rules": [
{
"name": "Comments: TODO",
"scope": "comments.todo",
"foreground": "var(bluish)"
},
{
"name": "Comments: FIXME",
"scope": "comments.fixme",
"foreground": "var(redish)"
},
{
"name": "Comments: Important",
"scope": "comments.important",
"foreground": "var(orangish)"
}
// ... more comment styles
]
}
Use these predefined color variables in your color scheme:
var(redish)
- Red tonesvar(orangish)
- Orange tonesvar(yellowish)
- Yellow tonesvar(greenish)
- Green tonesvar(bluish)
- Blue tonesvar(purplish)
- Purple tonesvar(pinkish)
- Pink tonesvar(cyanish)
- Cyan tones
Search for tags across your entire project with advanced filtering:
- All Tags:
Ctrl+Shift+P
β "Colored Comments: List All Tags" - Filtered Search: Choose specific tag types from the input handler
- Current File Only: Search only the active file
The search results show:
- Tag Type with emoji icon
- File Location with relative path
- Line Number and preview
- Syntax Highlighting in preview
- HTML Formatting for better readability
- Preview Mode - Hover over results to preview without navigation
- Transient Views - Quick preview without opening permanent tabs
- Position Restoration - Return to original position when canceling
- Smart Navigation - Jump to exact line and column
- Non-blocking file scanning
- Batch processing for large projects
- Debounced updates to prevent excessive processing
- Smart caching of comment regions
- Heuristic detection of text files
- Configurable filtering to skip binary files
- Directory exclusion for faster scanning
- Progress reporting during large scans
- Lazy loading of file contents
- Temporary views for unopened files
- Cleanup routines to prevent memory leaks
- Optimized data structures for large projects
Enable debug logging to troubleshoot issues:
{
"debug": true
}
Then use "Colored Comments: Show Debug Logs" to view detailed information about:
- Tag regex compilation
- File scanning progress
- Comment region detection
- Performance metrics
The plugin welcomes contributions! Key areas:
- Tag patterns for new languages
- Color scheme templates
- Performance optimizations
- UI/UX improvements
- Inspired by Better Comments by aaron-bond
- Built on sublime_aio for async support
- Uses sublime_lib for enhanced functionality
This project is licensed under the MIT License - see the LICENSE file for details.