tags:

views:

482

answers:

3

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>?

A: 

Is'n it relates vim shows question mark instead of character ?

It could be unicode character 0x0099, which has no graphical representation.

How to insert unicode - "u0099 in INSERT mode inserts a character with the unicode value 0x0099." (from here)

Malx
+6  A: 

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.

CMS
A: 

@CMS detailed searching directly for the character value. If the character is a word by itself (or you can add spaces quickly to make it so), you can also cursor over the character and type * -- which will search forward for the closest word to the cursor (# to go backwards).

Kris Kumler