Sublime Forum

Better comments for st3

#1

Hello, So before using sublime text I used Better comments plugin on Visual Studio. And I was wondering if it was possible to produce this same effect on sublime text 3 using sublime-syntax files or even plugins. Thanks in advance.

0 Likes

#2

This would be done using a sublime syntax file. As an example the builtin Java syntax highlights Javadoc comments:

/**
 * @param
 */
0 Likes

#3

OT: I must admit this plugin looks quite cool! :slight_smile:

1 Like

#4

I am still waiting for @wbond to approve my PR to add it to PackageControl, but, please see

ColoredComments

2 Likes

#5

@0verflow

See Colored Comments in Package Control the new version looks like this.

2020-03-12_09-56-26

3 Likes

#6

Super cool man, Thank you so much! I appreciate your work so much!! Also Is there any way to give feedback or a review on the plugin?

0 Likes

#7

Just a star on github or if you have issues/suggests then an issue will work.

0 Likes

#8

ST3 build 3211 under OSX

I suspect that this is down to my inexperience but having installed via Package Control, all types of ‘tagged’ comments show in the same way: inverse video:

57

I took a quick look at the package settings file and I don’t think I should have to mess with it… but a quick pointer would be much appreciated. Thanks in advance MC

0 Likes

#9

Run the following command

Colored Comments: Generate Color Scheme

0 Likes

#10

Bingo - thanks very much. Excellent package!

0 Likes

#11

How to i run that command?
“Colored Comments: Generate Color Scheme”

0 Likes

#12

I think the commands changed in a newer version, it is not present anymore if I see it correctly.

It should simply work out of box alongside with the CC Settings. Typing “Colored Comments:” in the Command Palette should suggest you the possible options.

At least here it works like a charm - day for day (thanks again @TheSecEng !)

0 Likes

#13

Hi there everyone,
I recently installed the extension and have the same problem as @erbaafidotama, could someone give me a pointer on how to configure it using the Settings / Overwrite Current Colorscheme commands?
Thanks so much in advance!

0 Likes

#14

Yes sorry I’ve neglected to maintain this package. It’s due for an update.

You need to Edit your color scheme and add some rules similar to these

{
  // http://www.sublimetext.com/docs/3/color_schemes.html
  "variables": {
    "important_comment": "var(region.redish)",
    "deprecated_comment": "var(region.purplish)",
    "question_comment": "var(region.cyanish)",
    "todo_comment": "var(region.greenish)",
    "fixme_comment": "var(region.bluish)",
    "undefined_comment": "var(region.accent)",
  },
  "globals": {
    // "foreground": "var(green)",
  },
  "rules": [
    {
      "name": "IMPORTANT COMMENTS",
      "scope": "comments.important",
      "foreground": "var(important_comment)",
      "background": "rgba(1,22,38, 0.1)",
    },
    {
      "name": "DEPRECATED COMMENTS",
      "scope": "comments.deprecated",
      "foreground": "var(deprecated_comment)",
      "background": "rgba(1,22,38, 0.1)",
    },
    {
      "name": "QUESTION COMMENTS",
      "scope": "comments.question",
      "foreground": "var(question_comment)",
      "background": "rgba(1,22,38, 0.1)",
    },
    {
      "name": "TODO COMMENTS",
      "scope": "comments.todo",
      "foreground": "var(todo_comment)",
      "background": "rgba(1,22,38, 0.1)",
    },
    {
      "name": "FIXME COMMENTS",
      "scope": "comments.fixme",
      "foreground": "var(fixme_comment)",
      "background": "rgba(1,22,38, 0.1)",
    },
    {
      "name": "UNDEFINED COMMENTS",
      "scope": "comments.undefined",
      "foreground": "var(undefined_comment)",
      "background": "rgba(1,22,38, 0.1)",
    },
1 Like

#15

Thanks, this helped a lot!

As a further comment for other people having a similar question. Do this:

  • Go to the command palette and use the command: “Colored Comments: Override Current Color Scheme
  • For me it opens two panels with the code @TheSecEng posted in the previous comment in the right one. Now tweak the rgba values (RGBA color picker) for each of the categories in this file you have and save it. At the top of the file you can set certain themes as detailed in the documentation link.
  • Done :white_check_mark:

One more point: for me the predefined colors at the top of the file (stored in the “variables” section) didn’t work, but when I replaced them with explicit RGBA it worked fine, so try editing them explicitly if the text is all darkish.

As said above, thanks for the excellent package!
Thanks so much for the help : )
Cheers,

0 Likes