There's a pretty general solution for disabling the non-breaking space in OS X for some apps:


Unfortunately, Xcode is not one of them, and the solution does not work.

Any ideas on how to disable Option-Space for Xcode specifically?

I'm using a slightly customized keyboard layout, created with Ukulele; perhaps it could be used to remap that particular combination?

I'd rather not use stuff like KeyRemap4Macbook (or whatever it's called), since I've experienced a considerable, unacceptable lag during typing when using that app with some remaps.


I have found a somehow dirty workaround to disable the key combination for Xcode only:

To disable alt/optspace add a new keybinding in the file IDETextKeyBindingSet.plist in the folder /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources.

Open the plist and add a new dictionary called 'Customized'. Create a new child named 'Insert No Alt-Space' with type 'String' and the value 'InsertSpace:'. Save the file.

Open Xcode -> Preferences -> Key Bindings -> Customized
Highlight 'Insert No Alt-Space' -> Key and enter alt/optspace.

In the future you will get an audible error message typing the combination but nothing will be written.

Until now i haven't found a method to just insert a space instead of a non-breaking space.

Probably you have to redo the modification with every new Xcode version.

| improve this answer | |
  • 1
    Thanks for your answer. While this is indeed a solution that would require re-applying the patch on each update, so far it's the only one that works. The bounty is yours. – Sea Coast of Tibet Apr 9 '15 at 5:34
  • not working with Xcode 8 any more, btw – Sea Coast of Tibet Jan 17 '17 at 22:41
  • Works as described in Xcode 10. – DevAndArtist Sep 15 '18 at 5:39

You must log in to answer this question.

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