Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlighting rspec in sublime text 2

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)

like image 690
benc Avatar asked Mar 19 '13 14:03

benc


2 Answers

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.

like image 192
AGS Avatar answered Sep 29 '22 09:09

AGS


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.

like image 20
ford Avatar answered Sep 29 '22 11:09

ford