Giter Site home page Giter Site logo

highlightwords's Introduction

HighlightWords

A Sublime Text 2 and 3 plugin for highlighting mutiple words in different colors

The following configuration options are available:

  • Regular Expression
  • Case Sensitive
  • Customize Highlight Colors
  • Define "Always Highlighted Keywords" with Customized Colors

Usage

  • Highlight: Select "Edit > Highlight Words > Highlight Words" and enter the words (separated by whitespace)
  • Unhighlight: Select "Edit > Highlight Words > Unhighlight Words"
  • Toggle Settings: Select "Edit > Highlight Words > Toggle Settings"
  • Edit settings file: Select "Preferences" > "Package Settings" > "HighlightWords", copy settings from default to user, and edit settings file. Available settings are:
  • "colors_by_scope": Change the highlight colors.
  • "permanent_highlight_keyword_color_mappings": Define always highlighted keywords with specified colors, such as "TODO" or "FIXIT". The optional "flag" parameter may be 0 (regex), 1 (literal), 2 (regex and ignore case) or 3 (literal and ignore case).
  • Perl-style regular expression patterns are accepted. For example, to highlight "fix a bug" but not "prefix with", the expression could be "\bfix .*\b".

Note: These commands are also available in Command Panel with prefix "HighlightWords:"

How to find color scope

  • Open the file that has some colour you want (e.g open C++ which have green strings)
  • Select the word that has colour you want to use

selection

  • Open console (ctrl+~ (tilde))
  • Paste view.scope_name(view.sel()[0].begin()) and press ENTER
  • Copy returned string, for mine selection it is source.c++ meta.function.c meta.block.c storage.type.c
  • Paste this string inside color property:

highlight

Color will change after you re-enter the tab

Contact me

Please visit me if you have any question or suggestion at: http://weibo.com/seanliang

highlightwords's People

Contributors

alkuzad avatar liuhewei avatar ruslanoid avatar seanliang avatar xacid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

highlightwords's Issues

case sensitive not function?

Not sure it's HighlightWords's issue or my pc's.
I tried to set "ignore_case:" to false and true, but it doesn't work at all.

And I also tried "Edit -> HighlightWords -> Toggle Settings -> Turn [Case Sensitive]: Off"
Still not working.

Sublime 3.0 Build 3143

Auto Highlight for the same “as selected parts of the text” and “substrings”

Is there the way to make in Sublime Auto Highlight for the same "as selected parts of the text" and "substrings/subsequences"? "WordHighlight" plugin highlights only whole words, not sequence of the any chars (for example: parts of two words devided with space). I need highliting of the text parts like ALT+F3 can do it, but this combo selects text for editing. I need only coloring of the same sequences of the chars I selected (not for editing, only coloring and highlight to quick find the same instances i selected).

global name 'REFRESH_INVERVAL' is not defined

Error reported when loading plugin: you can see messages below in console (ctrl + `).

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 272, in on_modified
    callback.on_modified(v)
  File "HighlightWords in /Users/lhw/Library/Application Support/Sublime Text 3/Installed Packages/HighlightWords.sublime-package", line 139, in on_modified
NameError: global name 'REFRESH_INVERVAL' is not defined

Seems that the definition of 'REFRESH_INVERVAL' should be put outside of the class 'HighlightKeywordsCommand'. (After done this, errors disappear.)

Not Highlighting New Instances

If I type a new instance of the words I chose to highlight they don't get highlighted. Probably an interval would be best or highlight_on_save: true. I don't think you would want to highlight every time some one types

into the document it does not get highlighted

Document:

Hello //highlighted

Highlight Words: Hello

Hello // not highlighted

Feature Request: Give highlight words definition box memory like the sublime find

I recently had something highlighted in my document, and accidentally cleared what I had set up in the highlight words definition box and pressed enter, then couldn't get it back. It would be really nice to be able to click inside the box and cycle through the previous entries and get back what I had before - similar to the find box in sublime.

Add a command to toggle highlight state for currently selected word

Let's add a command that would add the currently selected word to HighlightWords' list (or remove it from it if it's akready there).

I could try coding it up myself if you accept pull requests, but I have almost no experience in Python, and even less writing Sublime plugins, so it might be better if someone competent did that. :)

Always highlight a set of keywords

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 ?

Folding makes text color turn to color scheme default on subsequent highlighted results

  1. Paste the following in a new document:
  111
  222
v 333
       111
       222
       333
  111
  222
  333
      111
      222
      333
  444
  1. Call the command to Highlight Words (RegEx, Ignore Case) and enter:
1* 2* 3*
  1. Fold at the v button.
  111
  222
> 333 [...]
  111 *
  222 *
  333 *
      111 *
      222 *
      333 *
  444

* Text color on subsequent highlighted results stop getting the expected scope color and get the default color set by the color scheme (the same as the not highlighted string "444").

Still maintained?

I am developing a plugin with almost identical feature set Word-highlighter (name subject to change) and wanted to publish my package on Package Control and therefore issued a pull request. However, the maintainers quickly noted that my package is eerily similar to yours.

They therefore suggested that I should reach out to you and see if you are still maintaining this package, as well if you accept pull requests. I however do not feel like taking your package and turning it into mine since that would require a lot of work for me (writing test cases all over etc.).

Do you feel like our plugins are too similar to coexist on PC (don't consider the name - it will change before being published on PC)?

Highlight Selection Word or Block.

i love the ability of having different color for different selection ,but is it possible to extend that to color the whole selection whether its a word or a text block ?

Color picker

It would be nice to have the option to pick the color if we want.

Highlight capture part only?

Is it possible to highlight only the captured part?

I want to highlight the [X] portion of - [X], also to highlight TODO part of // TODO without highlighting every todo string.

I figured something like - (\[X\]) would work with regex enabled would work, but seems it will always highlight the entire string.

How to hide input field

I use this really nice plugin only with keywords. So I'm not in need for the input field for words to highlight, which is shown above the status bar.

Is there anyway I can turn this input field off?

Add More Examples

please add more examples to the README.md to explain how to hightlight words based on regex, etc

Can it be an open source project?

Searching through the repository I cannot find any mention to open source licence. By this project being on Github, I am allowed to fork it by the Github TOS (Terms Of Service). However I am not allowed to create derivative works from it (pull requests). Meaning I cannot fork this repository, change its code and perform pull requests without the danger/liability of being prosecuted by violating the All rights reserved copyright granted by berne convention law.

The original prime theme for Sublime Text has the licence following open source licence:

The MIT License (MIT)

Copyright (c) 2014 Karel Vuong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
  1. https://github.com/karelvuong/st-primer/blob/master/LICENSE

Can the project have the same licence?


Related issues:

  1. gamcoh/QuickEdit#2 Can it be an open source project?
  2. SublimeText/LaTeXTools#1175 Can it be an open source project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.