Sublime Forum

Bracket highlighting

#1

Bracket highlighting seems to work only with parenthesis.

It would be nice if it also worked with other kinds of brackets (greater/smaller than, curly brackets, square brackets) and if possible, with string delimiters (single quotes, double quotes, python’s triple double quotes, etc)

Bracket matching and bracket scope selection have the same problem (ctrl-m and ctrl-shift-m)

0 Likes

#2

Woops… forgot about that. My matchBracketsBraces was set to false by default.
Let’s hope for a matchBracketsAngle now :smile:

0 Likes

#3

Bracket matching vs. angle brackets will be available in the next beta.

This isn’t there for all the C style languages, where it’d be an annoyance. There’s no reason it couldn’t be added for languages where it makes sense though, like Python.

0 Likes

#4

[quote=“sublimator”]Yeah, another thing is the lack of auto closing with {} I think that’s something that should come by default with Sublime.

It would be quite nice if the highlighting worked some how for xml tags and if one of the ends wasn’t visible then it show up quite visibly on the minimap.[/quote]

I agree it would be very nice to have highlighted matching xml/html tags (ala notepad++)

for the other one sublime flexibility allows you to do it… (I agree it should be there by default tho)

Curly Braces.sublime-snippet

<snippet>
	<content><![CDATA[{${0:$SELECTION}}]]></content>
</snippet>

Add this to Default.sublime-keymap if you want it to work global like ] and parenthesis (I did)
If you want it language specific, put it in the right Default.sublime-keymap under X language folder (ex: PHP\Default.sublime-keymap)

  <!-- Auto curly braces -->
  <binding key="}" command="move characters 1">
    <context name="option" value="autoMatchEnabled"/>
    <context name="allSelectionsEmpty" value="true"/>
    <context name="allFollowingCharacter" value="}"/>
  </binding>
  <binding key="{" command="insertSnippet 'Packages/Default/Curly Braces.sublime-snippet'">
    <context name="option" value="autoMatchEnabled"/>
    <context name="allSelectionsEmpty" value="true"/>
    <context name="allFollowingText" value="^(\t| |]|$)"/>
  </binding>
  <binding key="{" command="insertSnippet 'Packages/Default/Curly Braces.sublime-snippet'">
    <context name="option" value="autoMatchEnabled"/>
    <context name="allSelectionsNonEmpty" value="true"/>
  </binding>
0 Likes

#5

change ] to }

0 Likes

#6

Not like that, no: just simple, character based matching of angle brackets, i.e:

|<a href="">|
0 Likes

#7

[quote=“sublimator”]

[code]

| |

[/code]

Like that, where | => lovely little underscore dressing? Awesomeness, cause I use Genshi, an xml based templating language for some sites. It’s a great little lib but it’s very fragile. “Error: Unmatched Tag”[/quote]

I would say both are good, but if I have to pick one I would go with sublimator one, which is the one in notepad++

0 Likes

#8

I agree it’d be a useful feature, but it has to be prioritised along with everything else. Simple angle bracket matching is a separate case, as it’s already implemented, just not exposed in current versions.

Fancier XML related functionality is the sort of thing that should be implementable via plugins, especially when the API allows plugins to add markers etc

0 Likes