Xcode 4 has a Focus code blocks on hover setting in Preferences > Text Editing. enter image description here

When you hover the mouse on a Code folding ribbon, the mentioned setting has the effect shown in image below. enter image description here Also, the effect stays put when you navigate with the keyboard (even when you move focus to Assistant editor, Navigator, Utilities, ... but not to, say, Organizer or Version editor).

How could you add a key binding for this?

  • Go to Settings > Keybindings and search for focus.

  • Then set your desired keybinding under Code Folding > Focus Follows Selection.

enter image description here

  • Was this added in Xcode 4.6? I could've sworn I already searched with "focus". :) Nevertheless, this is great. Thank you Bryan! – Blaz Feb 12 '13 at 17:39
  • I'm not sure when this was added. This also works on Xcode 4.5.2, which is the oldest version that I have installed for my computers. – Bryan Luby Feb 12 '13 at 17:55
  • Now I remember: the menu entry was there in Xcode 4 from the get-go, but was oddly disabled. – Blaz Feb 13 '13 at 6:40
  • OMG I just discovered this feature... super useful! – unom Jan 3 '14 at 14:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.