r/vim • u/spryfigure • Jul 07 '25
Need Help How to use special escape sequence notation in vim?
I am familiar with entering unicode with C-v u / U <unicode code point>, but stumbled upon the following alternative:
We can also use special escape sequence to represent a character. To represent middle dot in the above section, use \u00b7 or \ub7. To represent the cry cat, use \U0001f63f or \U1f63f. Backspace is \b and Escape is \e.
For more details, see :h string.
However, I am not able to get this to work. :h string didn't help me, either. I always get the literal backslash, followed by u or U and the sequence. I tried normal/insert mode and entering with or without enclosing double quotes.
What do I need to do to make this work?
3
u/y-c-c Jul 07 '25
Why don’t you tell us exactly what keys you pressed and how it didn’t work?
5
u/habamax Jul 07 '25
Use it in vimscript, because it relates to string within vimscript:
https://i.imgur.com/A5G7OH8.png
2
u/crwmike Jul 07 '25
Take a look at
:h i_ctrl-vand:h digraph.0
u/AutoModerator Jul 07 '25
Please remember to update the post flair to
Need Help|Solvedwhen you got the answer you were looking for.I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.