Find and replace non-breaking spaces in vim

You've copied and pasted into an html text editor only to find weird things going on in the browser. Lines aren't wrapping correctly. It seems like its just all one long word, but you know there are spaces.

Looking further into the issue you find that non-breaking spaces ( ) are everywhere!

So what to do?

Grab the text from your editor and paste it into vim.

Aside, on your mac you can install macvim with homebrew: brew install macvim

When you're in vim find all those pesky non-breaking spaces: /%xa0

Then replace the selection with normal spaces: :%s// /g

Or in one swoop: :%s/%xa0/ /g