In Xcode, if the cursor is on one brace (or bracket or parenthesis) of a matched pair, what keyboard shortcut will jump to the matching brace? Or how can I create such a shortcut?
An example of the feature I’m after is the "goto brace" shortcut in Visual Studio.
4
Answers
A partial solution is to use code folding. For example, to jump from the opening brace to the closing brace:
Since Xcode now has Vim mode you can use that and just hit
%
.(Adding this answer for completeness – I understand it kind of amounts to "just use Vim".)
There is a Balance Delimiters menu command. So simply assign it any keyboard shortcut you prefer (all commands have customizable key bindings). You can also double-click the first delimiter to perform the same action.
I had the same question and found a way to do this quickly, but it’s not a keyboard shortcut (you have to use the mouse):