Alvaro
Alvaro

Reputation: 57

Plugins HighlightWords in Sublime Text 3 How to configure?

Hello I have downloaded the Plugins HighlightWords to use it with Sublime Text 3 that promises to highlight words using some of the colors. Download it from here:

https://github.com/seanliang/HighlightWords

Could someone help me to change the color of highlighted by default. What I have tried I have not been able to do. This is the file to modify:

  {
   // The colors to highlight texts are specified by a list of theme scope names,
   // and HighlightWords uses this list in circular order.
   "colors_by_scope":
   [
      //"keyword",
      //"number",
      "string",
      "entity.name.class",
      "variable.parameter",
      "invalid.deprecated",
      "invalid",
      "support.function"
   ],
   "whole_word": false,
   "use_regex": false,
   "ignore_case": false,

   // Keywords to be always highlighted, clear the list to disable it.
   // "keyword" are literally matched, and "color" refers to theme scope names.
   // Note that json has some special characters like '\' should be escaped.
   "permanent_highlight_keyword_color_mappings":
   [
      //{"keyword": "TODO", "color": "support.function"},
      //{"keyword": "FIXIT", "color": "support.function"},
   ]
}

Upvotes: 3

Views: 684

Answers (1)

sergioFC
sergioFC

Reputation: 6016

You can override default plugin settings in plugin user settings. Goto menu Preferences > PackageSettings > HighlightWords > Settings-User , then add the words and colors you want overriding permanent_highlight_keyword_color_mappings property. Example content:

{    
    "permanent_highlight_keyword_color_mappings":
    [
        {"keyword": "stackoverflow", "color": "variable.parameter"},
        {"keyword": "sublime", "color": "string"},
        {"keyword": "plugin", "color": "invalid.deprecated"},
    ]
}

Save the file and maybe you need to restart sublime. Result:

HihglightWords plugin working example

Upvotes: 2

Related Questions