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

I am writing code in various text editors with Finnish keyboard layout. Sometimes I press alt+spacebar accidentally when writing symbols. E.g.

  if(foobar || foobar2) {

... there is a high change I type pipe+pipe+magical alt-spacebar character.

The thing is, this alt+spacebar character is invisible like space, but behaves differently. Mainly it breaks code syntax in various occasions. However, because the character is invisible it is hard to track down.

What is this alt+spacebar character?

Is it possible to disable it so that when you press alt+spacebar it would type in a normal space?

share|improve this question
up vote 10 down vote accepted

optionspace inserts a non-breaking space (NBSP, U+00A0) by default.

What I've done I've set my editor highlight the non-breaking space, so that I see when I accidentally enter it.

You could remap to a normal space by creating ~/Library/KeyBindings/ and saving a property list like this as DefaultKeyBinding.dict:

    "~ " = (insertText:, " ");
share|improve this answer
This doesn't work on Xcode, not sure why – josema.vitaminew Nov 24 '15 at 14:48

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.