Home » Questions » Computers [ Ask a new question ]

How to disable the Option-Space key combination for non-breaking spaces?

How to disable the Option-Space key combination for non-breaking spaces?

How to disable the annoying Option-Space key combination for non-breaking spaces?

Asked by: Guest | Views: 297
Total answers/comments: 5
bert [Entry]

"Make your ~/Library/KeyBindings/DefaultKeyBinding.dict file look like this (if it doesn’t exist create it, if there are already bindings in it just add the one from below):

{
""~ "" = (""insertText:"", "" "");
}

What does this do? Every time you press Option-Space instead of inserting a non breaking space OS X now inserts a regular space. Problem fixed.

You need restart the device to apply this change."
bert [Entry]

I use iTerm2 for most of my work and the mapping can be added in the "Keys" preference pane, by adding a new key combination in Preferences -> Keys -> the plus button. Note when adding the key make sure to put a single space in the lower box as shown.
bert [Entry]

"Using OSX Sierra (10.12.6), and resolved this very easy by using Karabiner-Elements:

github.com/tekezo/Karabiner-Elements

Once opened, go to ""Complex Modifications"" > ""Add Rule"" > ""Import more rules from the Internet"", and download the ""Disable alt+spacebar (nonbreaking space)"" rule. Add it, and you're done!"
"Using OSX Sierra (10.12.6), and resolved this very easy by using Karabiner-Elements:

github.com/tekezo/Karabiner-Elements

Once opened, go to ""Complex Modifications"" > ""Add Rule"" > ""Import more rules from the Internet"", and download the ""Disable alt+spacebar (nonbreaking space)"" rule. Add it, and you're done!"
bert [Entry]

"Since this is the answer that Google shows you when searching for ""How to disable non-breaking spaces in Sublime Text"" (see x3ro's answer) I thought I'd post the answer for Sublime Text on Linux. Add this to your key bindings:

{ ""keys"": ["" ""], ""command"": ""insert_snippet"", ""args"": { ""contents"": "" "" } }

Go to ""Preferences"" → ""Key bindings - User"" to edit your key bindings.

Note that the space in ""keys"": ["" ""] is a non-breaking space.

Also note that this key binding also affects widgets, like the search box. In other words, you can no longer type non-breaking spaces into your search box, which could be a problem. To disable non-breaking spaces just in the text editor, use this key binding instead:

{
""keys"": ["" ""],
""command"": ""insert_snippet"", ""args"": { ""contents"": "" "" },
""context"": [
{ ""key"": ""setting.is_widget"", ""operand"": false }
]
}"
bert [Entry]

A possible global solution is to set alt-space to something else like Show Notification Center in System Preferences > Keyboard > Shortcuts > Mission Control.