I am copy pasting a big chunk of code from an article in PDF format. The issue is that the operation is replacing every *
character (the multiply operator in Fortran) by some sort of slash character, which isn't the generic slach character in Vim (used for division in Fortran).
For example, consider the expressions:
s2 = exp(-w * t)
s3 = 1.0_wp / s2
When copy pasting, I get the following:
As you can see, the regular slash is highlighted in yellow while the asterisk character was changed to some other kind of slash. I could very well go over every character and replace them, but that's not very reliable and would take quite a while (few thousand lines of code...). Ideally, I'd like to change them all in the following manner:
%s/[wierd-slash]/\*/g
I've found how to search and replace unprintable characters. ga
or :ascii
prints the hexa/octa value of the character under the cursor (in my case hexa 2044). However, when running :%s/\%x2044/\*/g
, I can the error Err: pattern not found: \%x2044
.
Also, I've tried typing *
when the character is under the cursor (then I could search and replace last searched character) but it searched for the next word instead. In the example above, it would search for t
instead.