4

I wanted to add an unicode image of cat to my file, but when I press ctrl+v u 1 f 4 3 1 the result is ὃ1 rather than 🐱.

Vim always stops reading the code after the fourth character and then it just prints the number 1 at the end. It does the same thing when I try to just paste the cat from clipboard. All unicode characters with four digit codes work just fine.

Why is it so? How can I use longer unicode codes in vim?

2
  • What is the current file's encoding? set fileencoding? (with the ?). If it’s not utf-8 or similar, you’re out of luck, because the cat emoji won’t be representable in older encodings (like latin-1).
    – Boldewyn
    Jan 21, 2016 at 11:13
  • It is my .bashrc and it is in utf-8 for sure.
    – kub1x
    Jan 21, 2016 at 18:35

1 Answer 1

4

See :help i_CTRL-V_digit. You need to start the sequence with an upper-case U, because the cat emoji is outside the basic multilingual plane (the codepoints from U+0000 to U+FFFF).

1
  • And to end the input I use any non-numeric key. Thanks alot!
    – kub1x
    Jan 25, 2016 at 12:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .