Git Product home page Git Product logo

brackethighlighter's Introduction

Donate via PayPal Build Package Control Downloads License

BracketHighlighter

Bracket Highlighter matches a variety of brackets such as: [], (), {}, "", '', <tag></tag>, and even custom brackets.

This was originally forked from pyparadigm's SublimeBrackets and SublimeTagmatcher (both are no longer available). I forked this to fix some issues I had and to add some features I had wanted. I also wanted to improve the efficiency of the matching.

Moving forward, I have thrown away all of the code and have completely rewritten the entire code base to allow for a more flexibility, faster, and more feature rich experience.

screenshot

Feature List

  • Customizable to highlight almost any bracket.
  • Customizable bracket highlight style.
  • High visibility bracket highlight mode.
  • Selectively disable or enable specific matching of tags, brackets, or quotes.
  • Selectively use an allowlist or blocklist for matching specific tags, brackets, or quotes based on language.
  • When bound to a shortcut, allow option to show line count and char count between match in the status bar.
  • Highlight basic brackets within strings.
  • Works with multi-select.
  • Configurable custom gutter icons.
  • Toggle bracket escape mode for string brackets (regex|string).
  • Bracket plugins that can jump between bracket ends, select content, remove brackets and/or content, wrap selections with brackets, swap brackets, swap quotes (handling quote escaping between the main quotes), fold/unfold content between brackets, toggle through tag attribute selection, select both the opening and closing tag name to change both simultaneously, etc.

Documentation

https://facelessuser.github.io/BracketHighlighter/

License

Released under the MIT license.

brackethighlighter's People

Contributors

101100 avatar arianf avatar deathaxe avatar dominikserafin avatar douglas avatar drarok avatar eproxus avatar facelessuser avatar fichtefoll avatar hawur avatar ifdattic avatar jfcherng avatar justrjlewis avatar kragol avatar lwolfsonkin avatar michaelalandawson avatar michaelblyons avatar minorprophet avatar nsomar avatar obormot avatar pakanhu avatar pirate avatar prayagverma avatar princemaple avatar r-stein avatar rexdf avatar slhck avatar stimmermans avatar swashata avatar vitalee 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brackethighlighter's Issues

Direct color specification

Instead of defining new scope, why not allowing direct hex color definition across all scopes? It should allow #FFF, as well as #FFFFFF.

Something like:

"quote_scope" : "#ccc",
"curly_scope" : "entity.name.class"...

I know it's not very clean, but it would solve the problem very efficiently. For example, I tried and can't figure out how to define new scope. Theme files do not contain XML you specified (you mentioned that scopes are defined in themes)...

tag highlight for Ruby/Rails

I'm new to BracketHighlighter, but like it so far. However, how to I get highlighting to work when my View>Syntax is Rails. When I change the syntax to HTML, the tag highlighting works well. But, if I choose Ruby or one of the Rails, the tag highlight stops working. Quote and parenthesis works fine for those syntaxes.

Brackets too far apart not highlighted

In large/medium code blocks and methods the initial and ending brackets aren't highlighted.

Also happens when brackets are just 1 line apart but with a lot of code in that line (like a byte64 image).

Love the extension BTW =D

Gutter Icons missing?

I'm not sure if I messed something up, but I've tried a clean re-install and that didn't seem to fix anything. Is there some setting to turn on the gutter icons that I'm missing? Thanks!

@groups support

I have been looking for a way to include cssEDIT's @group css grouping to ST2.
I think your plugin might be a good solution as.... there is NONE out there.

I am not sure how to do it, but the open would be '/* @group' and the close '/* @EnD'

What do you think?
Possible?

Clutter Free UX

I like ST2 because of the clean interface and I also need this package.
It's great, but too much color, maybe if you can just put in an option to toggle between the color-block around the brackets/quotes to a simple colored underline or something, that looks nice & clutter free.

Hoping you get my view, I don't want to change colors n all, but a simpler clutter-free highlighter.

Having issues creating a new scope for theming

So I'm having some trouble getting my theme to highlight the colors that you have given. I'm using the scopes in the user settings for BH, and I added the entire theming copy and paste to my theme. Using a scope that already exists in the theme works, but the new scopes don't. I probably just screwed something up. Would it be possible for you to take a look at my theme file/plugin settings to see what I screwed up?

change color of bracket on highlight instead of background color

would it be possible to change the color of the brackets themselves when highlighted instead of highlighting via background color? i find it hard to see the actual bracket text when it is highlighted currently. plus the fact that the brackets turn red is probably my favorite feature from notepad++

BracketHighlighter cannot hint the missed bracket

Hi:
When you write a new file, brackethighligher(BH for short) can hint the pair of bracket of quotes. But if you open a existing file, you will find that it's difficult to find the missed bracket .
Any solutions? Or BH didn't implement this function yet?

Download Repo as Zip not Working

I am aware that downloading master as zip does not work for the repo currently. I am trying to get a hold of github to understand what is going wrong. I am not aware of anything wrong on the repo side, but I am looking into it. I suspect a github issue.

Package Control will not be able to install BracketHighlighter while this is broken.

Create the option to change the highligh color

Since everyone is using his own color scheme, this package should have the option for people to chose the color of the highlighted items.

Anyways it's a minor change but it would be nice thou.

thanks for you package, it's amazing. Keep up the good work.

Tweaking support for html template languages

Hi there - this isn't an issue as much as it is a request to be pointed in the right direction if possible

I'd like to be able to have BracketHighlighter nicely handle Django Templates. They use a {% %} open and close for tags, and {{ }} for variables. They of course are placed into HTML markup for flow and defining blocks. The ability to have BracketHighlighter understand {{ rather than just { would be very helpful, and i'm willing to put in some time to help achieve this.

Is this plugin geared to do something like this easily?... or is it specifically catered to single bracket types (which is okay as well of course).

Thanks for your work on BracketHighlighter.

Adding Retina display

Just an update, I already forked your repo and started working on the Retina display icons. Just some questions:

  • What OS do you have? (This is totally un-related.)
  • Did you use any specific font when making the icons? Or did you draw them yourself?
  • Do you have PhotoShop? (This is related.)

Eduan

Adding sanity check of "amount of selections"

A user reported on irc that using the "replace all" function or ALT+F3 on a really big document makes sublime hangs.

This was not reported as a problem with your plugin, but I tested this and with the plugin enabled sublime hangs.

I suggest adding a sanity check of "amount of selections", for example if there more than 10 selections skip every feature that the plugin adds.

Steps to reproduce:
1 - download this file: http://dl.dropbox.com/u/9303546/SublimeText/Packages/BracketHighlighter/test.html
2 - select <html>
3 - ALT+F3 ( this will add 9975 regions )
4 - once the selection is done press arrow right ">" then hit enter to add a new line.

With the plugin enabled this take ages, with the plugin disabled this takes seconds.

Only single bracket/layer at one time..?

On the illustration picture, it shows several layers being highlighted simultaneously. However, when I use the plugin, only one bracket is highlighted at a time. I can't find anything in the settings either. Am I missing something? I really want multiple colors and brackets to be highlighted at the same time.

Thanks! :)

Single line block

It would be very helpful to differentiate the case when a certain tag is opened and closed in the same line. Why? Because it has the same visual effect as if its opening/closing is outside the screen. Something like <.>, {.}, etc.

P.S.: Love this extension, a real must have in Sublime Text 2.

Allow specification of arbitrary brackets

I'm a Ruby developer and would love to be able to have "def" and "end" tags highlighted for method definitions to help see them aligned properly. Things like this:

if ...
end

def foo
end

while ...
end

until ..
end

Would this be possible with this plugin or is it out of scope?

Thanks!

Highlight ruby code blocks

Is it possible to highlight ruby code blocks with this plugin?
For example do..end, unless..end etc.

It is not clear how to do it according to the readme

thanks

Sample configuration of how to make the styling less prominent

This package seems to work wonderfully well โ€” thank you! :)

The only problem that I have with it so far is that it is very distracting. It is near impossible to see the cursor if it's next to one of the brackets being highlighted. This is a problem I never had with TextMate's bracket highlighting.

Is it possible to make it more subtle, and if so, how do you configure it that way? I cannot imagine I'm alone at this.

cant change highlight colors

hi facelessuser,

in the readme you say somewhere that :
"By default, the scope is "entity.name.class", but you could change it to "keyword" or any other scope in your theme." ...
"If you want more control of the colors, you can define your own scopes."

what do you mean by scopes. where do i paste the xml code ? i tried pasting it in Coda.tmTheme (i use the coda colour theme) but no change in the highight colors at all. where did i go wrong ?

Highlight all open brackets the cursor is in.

For example if we have something like this in c++:

{
    {
        asd( __cursor_here__ );
    }
}

Then all brackets would be highlighted, not only the one closest to cursor. Presumably each one with different color

Request: option to change bracket character color instead of outline

Currently the highlighting styles we have at our disposal are 'solid', 'outline', 'underline', and 'none'

I'd like to propose the addition of an additional option called 'character' that would simply change the font color of the bracket character itself, and not add anything around or under it.

color specification in the settings

I know it is childish but..
can you add color settings in the BracketHighlighter.sublime-settings so that we can tune it up according our taste?

I like it all a lot, but it the highlighter beats the eyes too much.. it distracts me more then help.

thanks a lot

Troubles with changing to underline

I can't for the life of me figure out how to change the highlight from background to underline.... I followed the readme and tried to paste this snippet into the "bracket highlighter > Settings - User" file and I get the following error

Error trying to parse settings: Unexpected trailing characters in ~/Library/Application Support/Sublime Text 2/Packages/User/BracketHighlighter.sublime-settings:2:19

Then after I deleted it out, I get this error on startup

Error trying to parse settings: No data in ~/Library/Application Support/Sublime Text 2/Packages/User/BracketHighlighter.sublime-settings:1:1

So I then tried to paste those into my sublime user file and that doesn't work either. What am I doing wrong??

 // Outline? (solid|outline|underline|none)
 "quote_style" : "underline",
 "curly_style" : "underline",
 "round_style" : "underline",
 "square_style": "underline",
 "angle_style" : "underline",
 "tag_style"   : "outline",

Suggestion: Use font and text instead of icons in gutter

Like many coders, I pick a font that helps me quickly identify/distinguish aspects of the code quickly. I also become used to what brackets in that particular font look like.

It would be very nice if, instead of icons in the gutters we could use the actual font we've chosen.

Other benefits of fonts over icons:

  • easy to have separate open {, close }, and open/close on the same line { } symbols
  • easier to extend with custom brackets

I'm not sure if non-image entities can be used in the gutter, but perhaps a light-weight font-to-image converter could be used if only images are allowed.

Bracket Highlighting Outlines

currently available outlines:
// Outline? (solid|outline|underline|none)

solid is actually solidColor+outline
which should infact apply ONLY solidColor to the highlight and NO outline.

As outline is ONLY outline, underline is ONLY underline.
In the same way solid should be ONLY solid.

There should be 1 more outline 'solid+outline' to apply both solid color & outline.

As for my case i only want solid color only to the highlights so selected solid, but its applying outline too which makes surrounding text & caret unclear to read.

Block Highlight

Add Block Highlight feature, much like VS 2012. Rather than the two bracket icons in the gutter (at open & close), highlight with a thin strip of customizable color. This helps a lot while checking scopes & looks good.

Ruby string interpolation: single quotes not highlighted

In a Ruby file, I have the following line:

message = "#{self.element_identifier} does not have attribute '#{attribute}'"

Moving left to right with the cursor, the double quotes highlight, the curly braces around self.element_identifier highlight then lose highlighting, but when the cursor gets to the single quotes around #{attribute}, they don't get highlighted. The curly braces do, but not the single quotes.

I don't know if this is related, but I also noticed that the double quotes retain their highlighting when the curly braces are highlighted. That seems inconsistent with what I've observed elsewhere.

Don't use Sublime default key binding

BracketHighlighter overrides the default keyboard shortcut for starting the "Run" build variant (ctrl+shift+b).
I don't know which one was first, but I think it's bad practice to override a key binding that is native to Sublime. If you must do so (for backwards compatibility reasons) I suggest at least providing an alternative shortcut that replaces the default "Run" shortcut.

Brackets inside quotes throw off quote match

Brackets inside a string can cause quote match to fail.

Can be fixed with a simple check that kicks out of bracket adjacent function if in the middle of a string.

Will post fix in next commit.

Highlight and dot color

How do I change these? I seem to only have 1 color, white, for all my tags. Your image appears to show a multitude of colors for different tags.

Highlight bracket in multipage

It seems that current version only highlight the bracket if both openning and closing bracket appear in one view page. For example, in long source code file, openning bracket in line 10 and close bracket in line 210 so it wasn't get highlighted.

how to remove border outline of the highlighted braces

using sublime 2

i want to remove the border of the highlighted braces & others.

When they are like {}| & there is no text between them and the text input caret's position is at its end, caret is not clearly visible. the space between the braces seems like a caret.

Highlight match HTML tags, even if they are contained in PHP code

Notepad++ highlights matching tags within PHP code which is superhandy. I've come to miss it after switching to ST2.

For example:

echo '<div class="a-class">';
foreach($array as $key => $val)
{
    echo $val;
}
echo '</div>';

Placing the cursor on </div> would highlight the matching <div>, even though it's contained in PHP code. Magic!

A number in Ruby method definition breaks highlighting

I've found that if I give a method a name which contains a number, i.e., "convert_2_something", the highlighting of that method breaks. Does the open pattern need to be changed to account for numbers in the naming scheme?

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.