I use VIM - Vi IMproved 7.0 (2006 May 7, compiled Feb 23 2007 22:17:23)
to write mainly XHTML/PHP and I sometimes have to get content from word
processed documents and paste it into Vim for HTML markup. This usually
results in having non-visually detectable characters (which I assume are
high ASCII) which display strangely on the Web.
Is there a way I can have my Vim highlight these characters so I can see
them and replace them with their HTML counterparts?
I've searched Google, the Vim e-mail archive, and I've helped Ugandan
children :), but I'm no closer to the answer.
Well, if you want to highlight them, you can do something like
:match Error /[\x7f-\xff]/
which should catch most of the offenders. Or you can search for
them with the same regexp. And if you have ":set hls", it will
highlight them too. :)
It does require certain knobs to be set properly in your
'cpoptions' setting, but if you run vim (rather than "vi"), they
should automatically be set unless you had reason to bung with them.
Once you're on a particular one, you can use
ga
to determine the ASCII value of the character in question, and
can use that value for search&replace.
Hope this helps,
-tim