Focus follows selection and Xcode 4

Since Xcode version 4.3 this is no longer an issue. The “Focus follows selection” menu entry has been resuscitated!

People still using older Versions of Xcode 4, may read on …

Finally Xcode 4 is here and the days of Version 3 are almost part of history.

There was one nifty feature that I liked very much in Xcode 3. It’s “Focus follows selection”. This feature was supposed to be in Version 4, since it can be found in the “Editor Menu” of Xcode 4, but oddly it’s always disabled. Even in Xcode 4.1 and 4.2 (beta).

So far for the bad news, but now for the good news: This feature is still available and functional in all Versions of Xcode 4. But you just can’t use the Menu to activate it. You have to open “Terminal” to do so. At the command prompt type the following:
defaults write com.apple.dt.Xcode DVTTextCodeFocusFollowsSelection -bool yes

Before you do so, make sure Xcode 4 is not running, because the setting may be overwritten when Xcode quits. After restarting Xcode “Focus follows selection” should work until you disable it with following command:
defaults write com.apple.dt.Xcode DVTTextCodeFocusFollowsSelection -bool no

With “Focus follows selection” enabled you can now fully concentrate on the block of code you’re working on – Even with Xcode 4!

  1. hroch32 says:

    I still don’t like Xcode 4, but this tip made my dislike much more milder! Thank you very very much!

  1. There are no trackbacks for this post yet.