Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM How do I search for a <XX> single byte representation

Tags:

vim

When I cut and paste from a Word document into VIM, quotes get translated into a-circumflex followed by <99>, where the <99> is a single byte representation. (Which I know because when I move to it, typing a single 'l' moves me right to the over all four characters).

I want to do search and replace, and I know enough to find the a-cirumflex digraph using control-K a>, but I can't figure out how to search for the <99>, and searching for the literal /<99> doesn't work.

So I really have two questions:

What help topic should I consult in vim to learn about what sort of a beast the <99> is (since it doesn't seem to be a digraph) (or maybe it IS a digraph and I'm missing something)?

How do I search for a single character represented by <99>?

like image 982
Leonard Avatar asked Jan 10 '09 04:01

Leonard


1 Answers

Try this:

Put your cursor over the character, type ga and you will see the hexadecimal representation of the character, then you can replace it with:

:%s/\%xNN//g

Where NN is the hex code of the character.

like image 106
Christian C. Salvadó Avatar answered Nov 01 '22 14:11

Christian C. Salvadó