Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted
  • Go to Settings > Keybindings and search for focus.

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

enter image description here

share|improve this answer
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! – unmircea Jan 3 '14 at 14:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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