When you cursor through a closing brace, TM highlights the opening one to help you balance it.
Im assuming this feature is in TM Core and not provided by a bundle as such
Is there a way to also get TM to highlight the opening brace, when you actually type the closing brace too?
Cheers
On 11 Nov 2014, at 17:23, Carpii UK wrote:
When you cursor through a closing brace, TM highlights the opening one to help you balance it.
Im assuming this feature is in TM Core and not provided by a bundle as such
Correct.
Is there a way to also get TM to highlight the opening brace, when you actually type the closing brace too?
This is not possible: The reason is that the animation is distracting. I have a note about implementing a less distracting (permanent) highlight that could be used during typing or when caret is on the item.
On 2014-November-11, at 9:28 am, Allan Odgaard wrote:
Is there a way to also get TM to highlight the opening brace, when you actually type the closing brace too?
This is not possible: The reason is that the animation is distracting. I have a note about implementing a less distracting (permanent) highlight that could be used during typing or when caret is on the item.
Hm, is it particularly more distracting than when moving the cursor? But permanent highlighting sounds interesting… something like the “focus” highlighting in Xcode, perhaps? (For anyone who hasn’t seen it, that dims the outermost scope slightly, and the next outermost scope slightly more, and so on. There’s a picture here: http://apple.stackexchange.com/questions/75745/xcode-4-key-binding-for-focus... ) It makes it easy to identify the entire block rather than a single character, and without distractions. I’d definitely appreciate a feature like that.
Anyway, if you really want a closing brace to flash its opening mate, a slightly ugly hack is to make a shortcut to type “}” followed by a left-arrow and a right-arrow. A Textmate macro won't quite work, presumably since you’re not actually pressing the right-arrow key, but you can program the amazing Karabiner (https://pqrs.org/osx/karabiner) to do it by adding this to its private.xml:
<item> <name>Textmate Brace Closer</name> <appendix>Turn "}" into }←→ to flash the opening brace</appendix> <identifier>private.bracer</identifier>
<appdef> <appname>TEXTMATE</appname><equal>com.macromates.TextMate.preview</equal> </appdef> <only>TEXTMATE</only> <autogen>--KeyToKey-- KeyCode::BRACKET_RIGHT, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_SHIFT, KeyCode::BRACKET_RIGHT, ModifierFlag::SHIFT_L, KeyCode::CURSOR_LEFT, KeyCode::CURSOR_RIGHT</autogen> </item>