seanliang / HighlightWords

A Sublime Text 2 & 3 plugin for highlighting mutiple words in different colors
https://github.com/seanliang/HighlightWords
58 stars 21 forks source link

Always highlight a set of keywords #9

Open mayuroks opened 10 years ago

mayuroks commented 10 years ago

keywords like TODO, FIXME, BADCODE, README etc are are found in most of my code. I want those words to be highlighted as soon as my sublime text comes up.

I can save those words to an array in my settings and and I want those words to always be highlighted. Is there way to do that ?

seanliang commented 10 years ago

Do you mean that the plugin will highlight those words automatic when the document is opened?

What will happen if you perform a manual highlight later?

  1. The keywords will not be affected, or
  2. The keywords will appear in the input panel and you can remove any of them, or
  3. The keywords will be removed from highlighting
mayuroks commented 10 years ago

YES the pluign should automatically highlight those words as soon as the document is opened. This feature is mostly about long term code-base development / maintainance rather than short-term word highlighting

The best solution to overcome conflicts is to have keyword-color list like this.

permanent_highlight_keyword_color_mappings: {'TODO': 'yellow', 'FIXME': 'red'}

there should be few more settings for permanent highlight like this

permanent_keyword_highlight_toggle_key: <SOME BUTTON> # turn on n off the prmently highlighted words
permanent_keyword_highlight_always: true # if set to false, you can use toggle key
permanent_keyword_hide_on_manual_search: true( DEFAULT ) # false to keep them highlighted in case of manual searches as well

And the new manual words should be highlighted using default colors, so to answer your questions 1) The keywords will not be affected or 3) removed from highlighting, THAT will depend upon these settings These settings will help in setting up my coding practices and deal with most of the regular stuff

2) Input panel can also be a good way when you wanna go deeper into highlight / searching in whichever way the user prefers.

I hope you get the idea.

seanliang commented 10 years ago

Ok. I'll try to implement this feature when I have time.

Enteleform commented 9 years ago

+1, this would be an awesome feature :+1:

laramjo commented 9 years ago

They could give me an example of how to change the color of the word to highlight

(google translate.)