, and even custom brackets. This was orig" /> , and even custom brackets. This was orig" /> , and even custom brackets. This was orig"/>

Bracket and tag highlighter for Sublime Text

Last update: May 12, 2022

Donate via PayPal Discord 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.

Copyright (c) 2013 - 2021 Isaac Muse [email protected]

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.

GitHub

https://github.com/facelessuser/BracketHighlighter
Comments
  • 1. Feature requests to allow using your plugin from another plugin

    Description

    You have helped me in the past by having a bh_async_key as well as a bh_key for synchronous behavior. That helped me define a command in terms of one of your commands.

    I have made use of your plugin tonight inside the sublemacspro plugin. I have been meaning to do this for ages and I had good success with that tonight.

    However, I encountered several issues which I wonder if you'd be willing to discuss.

    1. Is there a way to stop "Jump to Right/Left Bracket" from moving outside the brackets if already at the LEFT or RIGHT end? That is, if you're already at the RIGHT side and "Jump to Right Bracket" is there a way to get it not to move?

    2. I looked at the documentation and cannot figure out if I can easily add support for Ruby's backquote character. It should, as far as I know, be treated the same as a regular quoted string. I think it's easy and wonder if you can point me to the right documentation and also explain whether I can do it from within my plugin.

    3. Is there an API you can expose that allows me to ask the question "is the character at point a bracket highlighter open or close tag, bracket, string?" Because if so, that would just be perfect. What I have now is not perfect (see below).

    My reasons for this are to implement forward/backward s-expression for emacs. Right now I walk the buffer looking at characters, and then when I find bracket characters like one of "[{(", I invoke your code and it gets me to the other side. But what I'd really like to do is, be able to encounter a "begin" in ruby code and have it skip over to the matching "end". And currently, since my code is triggered when it encounters a "{" (for example), in Latex mode, when it encounters the "{" in \begin{equation} it actually goes to the match \end{equation} because bracket highlighter works its magic, but only because I encountered the "{".

    I hope this is clear what I am looking for.

    Support Info

    • ST ver.: 3125
    • Platform: osx
    • Arch: x64
    • Plugin ver.: 2.23.1
    • Install via PC: True
    • mdpopups ver.: 1.12.0
    • backrefs ver.: 1.0.post1
    • markdown ver.: 2.6.6
    • pygments ver.: 2.1a0
    • jinja2 ver.: 2.8

    Steps to Reproduce Issue

    No real steps here. Just a discussion.

    Reviewed by canoeberry at 2017-01-03 21:14
  • 2. Highlight the block of code with vertical line as in Geany

    At first, thank you for your amazing plugin!!

    I would like to ask if it's possible to mark the block of selected code not only with underscores on brackets but also with vertical line on the left of it, like in Geany. (see orange line on the left)

    Example:

    highlight_as_geany

    If it's not possible at the moment, could you please implement this feature in the near future? In case I missed it, my apologies but could you please then show the piece of code that could do it?

    Thanks

    Reviewed by iliajie at 2014-07-25 10:56
  • 3. no bracket icons in gutter but tags gets highlighted correctly

    Requirements

    Do not delete this. Template must be followed or the issue will be marked Invalid and closed.

    Please mark if you have done done this. Mark by placing an x in the box: - [ ] -> - [x]. Support will not be offered without this.

    • [x] Search past issues and read the area of the documentation related to your specific question, issue, or request. Often the answer to your question is already found there. You may also find the feature you are requesting already exists. It is okay if after doing this you are still confused, just mention what you didn't understand in the documentation below so we can make it better.

    Description

    For bugs, provide errors from console, examples etc. For feature requests, describe the desired feature. Be as detailed as possible. Vague issues/requests will be marked with Insufficient Details for about a week. If not corrected, they will be marked Stale for about a week and then closed.


    Issue Support Info

    For bugs, run the following command from the menu: Preferences->Package Settings->BracketHighlighter->Support Info. Post the result here. Omit for feature requests.

    • ST ver.: 3120
    • Platform: osx
    • Arch: x64
    • Plugin ver.: 2.21.5
    • Install via PC: True
    • mdpopups ver.: 1.10.0
    • backrefs ver.: 1.0.post1
    • markdown ver.: 2.6.6
    • pygments ver.: 2.1a0
    • jinja2 ver.: 2.8

    Steps to Reproduce Issue

    1- the tag is picked up correctly, but no icons in the gutter 2- style & script doesnt have any (no icons , no underline) , only <> is being highlighted.

    • this is a vue component file ".vue"

    test

    <template>
        <div class="Alert Alert--{{ type | capitalize }}" v-show="show">
            <slot></slot>
            <span class="Alert__close" @click="hideAlert()">x</span>
        </div>
    </template>
    
    <style>
        body {
            padding: 100px;
            margin: 0;
        }
        .Alert {
            background-color: #aaa;
            margin: 0 auto;
            color:  white;
            padding: 1rem;
            display: inline-block;
            position: relative;
            border-radius: 4px;
            width: 25%;
        }
        .Alert--Success {
            background-color: #2ecc71;
        }
        .Alert--Error {
            background-color: #e74c3c;
        }
        .Alert__close {
            position: absolute;
            top: 10px;
            right: 10px;
            font-weight: bold;
            cursor: pointer;
        }
    </style>
    
    <script>
        export default {
            props: ['type'],
    
            data: function() {
                return {
                    show: true
                };
            },
    
            methods: {
                hideAlert: function() {
                    this.show = false;
                }
            }
        }
    </script>
    
    Reviewed by ctf0 at 2016-09-12 17:58
  • 4. Retina Icons

    Hi, I designed a first version of all the icons for retina displays. I would really appreciate any comments to improve them. Regarding the typography, I used Source code Pro. Thanks!

    Reviewed by vemec at 2013-07-16 15:13
  • 5. Not finding an specific function end in Lua

    Description

    Using Lua (Roblox Lua), this kind of opening/closing function is not being recognized:

    Item.MouseLeave:connect(function() 
    	-- anything...
    end)
    

    image

    Reviewed by rogeriodec at 2020-10-30 16:49
  • 6. Added a lot of new icons

    Added all of the icons that you asked me to add. :)

    Still haven't tested cause I wasn't able to figure it out, so I suggest you test it before accepting. :)

    • Eduan
    Reviewed by greduan at 2012-10-26 23:33
  • 7. Sublime Text 3 bracketHighlighter dont know how to color bracket underlines

    I dont know how to change the underline color of the brackets using brackethiglighter i did check http://facelessuser.github.io/BracketHighlighter/customize/#configuring-highlight-style but i dont understand it im new to Sublime Text 3 and BH

    Reviewed by ghost at 2016-08-17 14:07
  • 8. Recently BracketHighlighter doesn't (fill in blank) [new release]

    This is for the inevitable issues resulting in the recent push. I just pushed BracketHighlighter version 2 to the master, and things are going to seem a bit different, so before you file an issue please read the readme https://github.com/facelessuser/BracketHighlighter/blob/master/readme.md

    If you are just confused on how to do something after reading the readme, please post here and do not create an issue unless there is actually an issue.

    Thanks, I hope you enjoy BracketHighligher 2.

    Reviewed by facelessuser at 2013-03-24 20:51
  • 9. 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!

    Reviewed by ryanlecompte at 2012-01-02 12:36
  • 10. Lua - wrong scope highlighting in while loop

    It looks like while loop scope is highlighted wrong with the built-in Lua syntax. The second end keyword is excessive and is not part of the while loop. And there is the same problem with for loop.

    Reviewed by bofm at 2018-01-26 13:45
  • 11. Closing TAG mark wrong opening tag

    If i click on open tag, right closing tag is market out. But if i click on closing tag, first opening tag above is marked out.

    Right opening tag is market with underline (default sublime tagOptions marker)

    • ST ver.: 3126
    • Platform: osx
    • Arch: x64
    • Plugin ver.: 2.23.3
    • Install via PC: True
    • mdpopups ver.: 1.13.1
    • backrefs ver.: 1.0.post1
    • markdown ver.: 2.6.6
    • pygments ver.: 2.1a0
    • jinja2 ver.: 2.8

    Info has been copied to the clipboard.

    Same part of code with correct markup, when i click on opening tag snimka obrazovky 2017-03-24 o 2 55 45

    Wrong markup, when i click on closing tag snimka obrazovky 2017-03-24 o 2 55 52

    little different problem on "a" tag:

    when i click on opening tag looks good snimka obrazovky 2017-03-24 o 3 08 24

    but when i click on closing "" tag is marked only with rounded border, and again default underlined markup is present... next to line number i have "?"

    snimka obrazovky 2017-03-24 o 3 08 32
    Reviewed by gavalierm at 2017-03-24 01:54
  • 12. Ruby endless method syntax

    Description

    New Ruby endless method syntax breaks the Bracket Highlighter:

    def method_name() = method_definition
    

    It would appear that the Bracket Highlighter is looking for an end keyword to pair with the def. However, the new endless method syntax does not require this end.

    Screenshot 2022-01-30 at 14 22 28

    Support Info

    • ST ver.: 4126
    • Platform: osx
    • Arch: x64
    • Plugin ver.: 2.29.2
    • Install via PC: True
    • mdpopups ver.: 4.2.1
    • backrefs ver.: 5.0
    • markdown ver.: 3.2.2
    • pygments ver.: 2.1a0
    • jinja2 ver.: 2.10.1
    Reviewed by samrjenkins at 2022-01-30 14:24
  • 13. Feature requests: toggle to select only the beginning and end lines of the brackets or only lines of their content

    There is an example with an if / end in Lua:

    image

    The inner instructions (print) have 2 tabs ident, I want to fix them to only 1 tab. So I press ctrl+alt+super+s (Select text between brackets):

    image

    In this case, it's selecting also the first line (if), but I need only lines 2 and 3 (print): image

    In a reverse case, I would like to select only the start and end lines (if / end), for example, to get rid of them and leave only the inner lines (print):

    image

    Reviewed by rogeriodec at 2021-08-28 13:55
  • 14. Swap Quotes fails (or works inconsistently) for embedded/interpolated Ruby strings

    Description

    The "Swap Quotes" function, intended to switch a double-quoted string to a single-quoted string or vice versa, sometimes does nothing, but results in an error dumped to the console. (This does not always occur with every attempt to swap quotes -- sometimes it works. It is inconsistent.)

    This is with Sublime Text v3.2.2, build 3211 (which states "no updates available") and BracketHighlighter v2.29.0 (believed to be the most recent version because Package Control says no updates are available).

    This occurs in Ruby files (.rb suffix). I am just using the built-in Ruby support in Sublime Text 3, no additional plugins or packages. It seems to occur most-often when I attempt to swap the quotes of a string that is inside another string's interpolation. For example, in the following statement:

    config.x.error_source = "#{ENV.fetch('HOSTNAME', "name-of-app")}-#{ENV.fetch('ENVIRONMENT', Rails.env)}"

    attempting to swap the quotes of 'HOSTNAME', "name-of-app", or 'ENVIRONMENT' will all fail. This is true for both the single-quoted strings like 'HOSTNAME' as well as the double-quoted string "name-of-app".

    Swap Quotes also sometimes fails on strings that are not part of another string's interpolation. For example, attempting to swap the outer double-quotes of the example string above for single-quotes does work on the first try (resulting in '#{ENV.fetch(\'HOSTNAME\', "name-of-app")}-#{ENV.fetch(\'ENVIRONMENT\', Rails.env)}', but attempting to then re-swap those single-quotes back to double-quotes also fails.

    Support Info

    • ST ver.: 3211
    • Platform: osx
    • Arch: x64
    • Plugin ver.: 2.29.0
    • Install via PC: True
    • mdpopups ver.: 3.7.5
    • backrefs ver.: Version could not be acquired!
    • markdown ver.: 3.1.1
    • pygments ver.: 2.1a0
    • jinja2 ver.: 2.10.1

    Steps to Reproduce Issue

    1. With a ruby file open, place the cursor inside a single-quoted string, especially one that is inside another string's interpolation.
    2. From the Tools menu, choose Packages --> BracketHighlighter --> Swap Quotes (or use your configured keyboard shortcut.

    Expected Behavior

    The single-quotes around the string should be replaced with double-quotes.

    Actual Behavior

    No visible change is made in the open file, but the following error sometimes appears on the Sublime Text console:

      File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1082, in run_
        return self.run(edit, **args)
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 889, in run
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 895, in execute
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 400, in match
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 140, in init_match
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 127, in refresh_rules
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_rules.py", line 206, in load_rules
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_rules.py", line 257, in parse_bracket_definition
      File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_logging.py", line 19, in debug
    AttributeError: 'NoneType' object has no attribute 'load_settings'```
    Reviewed by rusterholz at 2021-03-10 19:56
  • 15. Support tagnameselect in *.vue files

    Description

    Command bh_modules.tagnameselect does not work in vue files

    Support Info

    • ST ver.: 3211
    • Platform: linux
    • Arch: x64
    • Plugin ver.: 2.28.1
    • Install via PC: True
    • mdpopups ver.: 3.7.5
    • backrefs ver.: 3.5
    • markdown ver.: 3.1.1
    • pygments ver.: 2.1a0
    • jinja2 ver.: 2.10.1

    Steps to Reproduce Issue

    1. Create vue file with template section and some tags in it
    2. Put cursor on tag
    3. Run bh_modules.tagnameselect
    Reviewed by Darkside73 at 2020-08-25 10:12
  • 16. Added `user_swapping` and `user_wrapping`

    I added a new user_swapping and user_wrapping functionality mirroring the user_brackets and user_scope_brackets functionality to allow users to override some of the upstream options without losing out on future updates.

    Reviewed by lwolfsonkin at 2019-05-23 06:45
MagentoSnippets - Magento Front End Snippets, plugin for Sublime Text

MagentoSnippets Magento Front End Snippets, plugin for Sublime Text. This tool serves to aid the productivity during the Magento's theme development t

Dec 31, 2020
Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use.
Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use.

Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use. This package allows you to use Shiki from PHP.

May 7, 2022
Laminas\Text is a component to work on text strings

laminas-text This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Mar 8, 2022
LaraNx Seo enables your Laravel app to store SEO and social media meta tag data in database instead of your code
LaraNx Seo enables your Laravel app to store SEO and social media meta tag data in database instead of your code

LaraNx Seo enables your Laravel app to store SEO and social media meta tag data in database instead of your code. Moving marketing data out of your code base and into your database where it is easily modified.

Feb 9, 2022
Google Tag Manager for Magento 2 with Advance Data Layer
 Google Tag Manager for Magento 2 with Advance Data Layer

Google Tag Manager is a user-friendly, yet powerful and cost-effective solution that is a must-have integration for every Magento store. It simplifies the process of adding and managing third-party JavaScript tags. With dozens of custom events and hundreds of data points our extensions the #1 GTM solution for Magento.

Apr 12, 2022
JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

Apr 15, 2022
[READ-ONLY] CakePHP Utility classes such as Inflector, Text, Hash, Security and Xml. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Utility Classes This library provides a range of utility classes that are used throughout the CakePHP framework What's in the toolbox? Hash A

Feb 15, 2022
Engine for performing and rendering text diffs

Text_Diff Engine for performing and rendering text diffs This package provides a text-based diff engine and renderers for multiple diff output formats

Jan 4, 2022
PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

May 15, 2022
Laravel package to convert English numbers to Bangla number or Bangla text, Bangla month name and Bangla Money Format

Number to Bangla Number, Word or Month Name in Laravel | Get Wordpress Plugin Laravel package to convert English numbers to Bangla number or Bangla te

Feb 11, 2022
Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files
Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files

toKirby Perch Dashboard app for exporting content to (Kirby) text files and Kirby Blueprint files. You can easily install and test it in a few steps.

Jan 15, 2022
Text - An experiment with WebSockets and the human condition.

An experiment with WebSockets and the human condition. I wanted to learn how to use WebSockets in pure PHP and JavaScript, so I came up with the simpl

Apr 10, 2022
A PHP component to convert HTML into a plain text format

html2text html2text is a very simple script that uses DOM methods to convert HTML into a format similar to what would be rendered by a browser - perfe

Apr 28, 2022
A PHP library to convert text to speech using various services

speaker A PHP library to convert text to speech using various services

Apr 14, 2022
Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways like sslcommerz, greenweb, dianahost,metronet in Laravel framework

Xenon\LaravelBDSms is a sms gateway package for sending text message to Bangladeshi mobile numbers using several gateways for Laravel. You should use

May 18, 2022
Control all text in multiple file bad words filter with worps
Control all text in multiple file bad words filter with worps

About Worps | PHP! Control all text in multiple file bad words filter with worps If you try online Click What to do use for worps Create new object Wo

Dec 30, 2021
An easy code to send messages on a discord text channel with webhook.

Status Webhook-Discord An easy code to send messages on a discord text channel with webhook. Don't forget to check the latest version of Webhook-Disco

Dec 3, 2021
Recoded, added features, removed useless stuff, more efficent code, PER PLAYER TEXT
Recoded, added features, removed useless stuff, more efficent code, PER PLAYER TEXT

WFT - 1.2.0 (BETA) Hello, and welcome to WFT. NOW IN API 4.0 This is the official recode of my old plugin WFT, witch had some issues. Overall I was no

Apr 22, 2022