Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

1 Answer 1

up vote 7 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

Your Answer

 
discard

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.