Last Updated: September 09, 2019
·
5.475K
· x3ro

Dealing with Alt+Space (non-breakable space) in Sublime Text 2 on OS X

If you are working on OS X you've probably come across the issue that "Alt+Space" inserts a non-breakable space into your code/document. This problem is not easily fixable for all applications, as far as I know, but here is an easy solution for Sublime Text 2, my favorite editor:

Simply insert the following custom keybinding into your user-specific key map. To do that, go to Sublime Text 2 > Preferences > Key Bindings - User and add the following snippet:

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

This will insert a plain old regular space instead of an annoying non-breaking one :)

4 Responses
Add your response

Simple but effective workaround. And I wouldn't want to create it globally… so this is perfect.

over 1 year ago ·

This saved my year. Thanks!

over 1 year ago ·

Wow, that is SOOO useful :)

over 1 year ago ·

actually theres also no good way for non-breaking-hyphens other than this.
thanks for the tip!

over 1 year ago ·