Sublime Forum

Different colors for the different types of comments

#1

Is it possible to set up different colors for some types of comments?
I’m using many comments in my draft code and usually it’s almost non visible, cuz it’s mostly just technical information. But I’d like to use some critical comments and see it brightly.
For example, PHP has two variants for comments - // and #
Could I chance to bind // to one color and # for another?

2 Likes

#2

In PHP syntax all 3 kind of comments (//, # and /**/) have different scopes:

// embedding.php text.html.basic meta.embedded.block.php source.php comment.line.double-slash.
# embedding.php text.html.basic meta.embedded.block.php source.php comment.line.number-sign.php
/**/ embedding.php text.html.basic meta.embedded.block.php source.php comment.block.php

so yes, is possible to visually differentiate all of them.

Hint: use Ctrl+Alt+Shift+o to see the applied scope at cursor point.

1 Like

#3

Should be { "keys": ["ctrl+alt+shift+p"], "command": "show_scope_name" },.

1 Like

#4

yep, you’re right :slight_smile: it’s ctrl+alt+shit+p … my bad :frowning:

0 Likes

#5

Thank you very much!

0 Likes