I want to replace a character with its hex literal. For example before regex:
I'm trying this:
But this replaces it with
What am I doing wrong? Is this even possible?
In that way,
printf expects a decimal number to be converted to a hexadecimal one. All you need to do is convert the character to a number as follows:
:help char2nr() for details.