7

The amount of DO END in my test files are getting confusing.

Is there a way to highlight the matching pairs of a DO or END in sublime text 2?

Bracket Highlighter doesn't have this functionality (although the developer is looking into it)

2 Answers 2

6

Edit

~/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bh_core.sublime-settings

Add "RSpec" to the language list.

// Ruby conditional statements
    {
        "name": "ruby",
        "open": "(^\\s*\\b(?:if|case|until|unless|while|begin|class|module|def\\b\\s*[a-zA-Z_\\d]+)|do)\\b",
        "close": "\\b(end)\\b",
        "style": "default",
        "scope_exclude": ["string", "comment"],
        "plugin_library": "bh_modules.rubykeywords",
        "language_filter": "whitelist",
        "language_list": ["RSpec", "Ruby", "Ruby on Rails", "HTML (Rails)"],
        "enabled": true
    },

The result

Result

EDIT

Installing the Bracket Highliter "BH2" branch via package control:

Open

~/Library/Application Support/Sublime Text 2/Packages/User/Package Control.sublime-settings

and add

"repositories":
[
    "https://github.com/facelessuser/BracketHighlighter/tree/BH2"
]

Then from the package control drop down menu: Package Control: Upgrade Package and select Bracket Highlighter.

Sign up to request clarification or add additional context in comments.

6 Comments

The bh_core.sublime-settings file doesn't exist on my system. Does it need to be created? Bracket highlighter is installed via package manager
See my edit for installing the BH2 branch via package control.
Thanks. Installed ok, added "Rspec" and restarted, but still no do end highlighting. Any suggestions?
Do you have the ST2 Rspec plugin installed? If so, is your syntax set to RSpec?
|
3

I needed only to install the BracketHighlighter package (using the default repository in Package Control) and restart Sublime (important!). The answer by AGS is out of date.

1 Comment

Accepted this up to date answer for anyone who stumbles across this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.