I am new to Neovim/Vim, and I am using the Neovim from Scratch config as a starting point. It works well for me for the most part. I have a peculiar encoding issue affecting emoji that prevents emoji from rendering properly from the moment I yank them in Neovim.
Instead of seeing a line like this: "I have a 🎂 (cake) emoji and a 🍏 (apple) emoji"
I see a line that looks like this: "I have a üéÇ (cake) emoji and a üçè (apple) emoji"
My question: How do I resolve this emoji rendering issue? Alternatively, where should I look next to troubleshoot this issue?
Steps to reproduce
- I have text in Neovim that includes an emoji character;
- My test used this line that I created in TextEdit in plain text mode: "I have a 🎂 (cake) emoji and a 🍏 (apple) emoji";
- I copied that from TextEdit using the
CMD ccommand, and pasted it into Neovim using
CMD v, and it rendered correctly;
- I then copy the text from Neovim using
yin Normal mode, and paste it into TextEdit, and I see "I have a üéÇ (cake) emoji and a üçè (apple) emoji";
- I did the same test from the command line in iTerm (I've tried the same thing in the Kitty terminal emulator with the same result) where I copied the same time in iTerm2 to TextEdit, and the line pastes correctly;
- I noticed that if I copy the line from TextEdit using
CMD cand then paste into Neovim using
pin Normal mode, I see the incorrectly rendered text.
Here is a video demonstrating the issue: https://cln.sh/VPzgydIs5CDYj4cPcXkl
An interesting observation is that if I have the same file open in Neovim and VS Code and update on either side, the other app accurately displays the content with the emoji. This issue only seems to manifest when I use the Vim
- My encoding in Neovim and iTerm2 is set to UTF-8.
- I am using macOS 12.1 and Neovim 6.1 (the issue was present in Neovim 6.0 too).
- I am using the Nerd Font modified version of JetBrains Mono
- As I mentioned above, I am also using the Neovim from Scratch config for Neovim as I'm a newbie, and this gives me a great foundation to use Neovim.
I'd appreciate any help or pointers here. I could abandon the use of the emoji entirely, although I tend to use them in my daily flow so I'd prefer to be able to keep using them.