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?

1 Answer 1

  • 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, 2013 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, 2013 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, 2013 at 6:40
  • OMG I just discovered this feature... super useful!
    – unom
    Jan 3, 2014 at 14:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .