I'm learning Arabic and I'd like to use Vim for taking notes. I tried a few different setups on Windows 10 and so far the closest to a good setup seems to be vim in MSYS2. MSYS2 renders Arabic text correctly, written from right to left, but when I open the file in Vim, while the text is still written from the right to left with Arabic characters, the letters are not connected.
Here are a few examples using cat:
سريع
اعتن بنفسك
بطيء
أن تقلق
لا تقلق
And the same ones from Vim:
ﺱﺮﻴﻋ
ﺎﻌﺘﻧ ﺐﻨﻔﺴﻛ
ﺐﻄﻳﺀ
ﺄﻧ ﺖﻘﻠﻗ
ﻻ ﺖﻘﻠﻗ
Looking up the first word of the terminal output on http://unicode.scarfboy.com/ gives me these:
Constituent codepoints:
0633 ARABIC LETTER SEEN
0631 ARABIC LETTER REH
064A ARABIC LETTER YEH
0639 ARABIC LETTER AIN
And the codes for the same word in Vim are:
Constituent codepoints:
FEB1 ARABIC LETTER SEEN ISOLATED FORM
FEAE ARABIC LETTER REH FINAL FORM
FEF4 ARABIC LETTER YEH MEDIAL FORM
FECB ARABIC LETTER AIN INITIAL FORM
This looks like it's interpreting the text the wrong way around, the first letter should be in the initial form and the last one should be in its final form.
When I try entering :set arabic
, the direction of writing changes for both Arabic and Latin text, making everything backwards, but the characters are rendered correctly (just at the wrong place).
Is there maybe a way to make vim output text the same way the terminal does? Maybe just change which characters are considered first and last, because MSYS2 is outputting the text correctly.
On a side note, my preferred setup would be to use vim in WSL, inside Windows Terminal, but that's not that important as long as I end up with something usable.