Is there any way to make comments stand out (bold/color)?

Sometimes I really want an important commment to stand out from the rest. Currently, the way I do this is to add @todo in front of the comment, but this is annoying because it's not actually a todo item (I just want the line to stand out).

Is there any kind of markup available that can make text bold and/or change the color, kind of like a todo?

Thanks!

2

Not really.

But you still can use TODOs for that:

  • just use different marker/"prefix" (instead of "todo", e.g. "NOTE:") -- "Settings | TODO". You can set up different colors just for that.
  • in actual TODOs tool window, you can set up filtering to filter out such fake todos


Alternatively, use different comment type. IDE can have different colors for // (line comment) or /* */ (block comment) and /** */ (PHPDoc block comment)

3

As of 2022 you can actually add new patterns with cutomize colors in "SETTINGS | Editor > TODO"

2

I "fixed" this by adding this TODO pattern in settings:

\/\/ [^ ].*

It matches a comment that start with two slashes, exactly 1 space and whatever follows (but no space right after the first one!)

So you can use:

// This is an actual comment that you can give a standing out color
letsDoThis();
// Comment out code below
//if ($condition) {
// doSomething()
//}
3

You can add the “Better Highlights” plugin. Then in Settings → Editor → Better Highlights → Comment Tokens you can add your custom tokens and their style to highlight.

0

请先登录再写评论。