Last Updated: February 25, 2016
·
1.257K
· pose

Avoiding Non-breaking spaces

In Mac OS X, if you press Option + Space you will get the following character: " ". It can cause trouble in browsers when present in Javascript files. It's ascii code is 160 and is called Non-breaking space.

With JSHint: You can enable the rule nonbsp to get errors when that character is present. (Also, if using NPM you may want to enable pre-commit hook validation)

With vim: You can change listchars to show ¬ where the non-breaking spaces are present. Check this vim tip to highlight them. In addition, if you are using solarized theme, you will need to do some extra work to get it working.