On Wed, 14 Aug 2013 01:06:30 +0200 Tony Mechelynck <[email protected]> wrote: > Adding a new keymap file to Vim requires no knowledge of the C > language; Vim mustn't even be recompiled, it's just a runtime script. > It is not even hard to make one once you get the hang of it, see > http://vim.wikia.com/wiki/How_to_make_a_keymap > > The keymap I use for Arabic is one I wrote myself, with no Arabic > letters printed on my keys and no knowledge of the keyboard layouts > commonly used to write Arabic, Persian, Urdu, and the other languages > whose script is based on the Arabic abjid. In many cases though, I > have to hit two or even sometimes three keys in succession to produce > one Arabic letter or diacritic. You may or may not find that keymap > useful, either to use it yourself, or as a source of inspiration to > design your own; I have uploaded it as > http://users.skynet.be/antoine.mechelynck/vim/arabicbis_utf-8.vim — I > tried to comment it as fully as possible, even mentioning in comments > a lot of Unicode codepoints for which I had no use and didn't set up > a mapping; you may want to replace the leading double quote in some > of these by an {lhs} {rhs} pair if you need to use those "outlandish" > characters.
Thanks for information and sharing your keymap. Farsi is my native language and it's very common for me to write in Farsi or read it. So I have installed Farsi keyboard layout. > Aside from keymaps, there is one thing about Arabic and Arabic-like > writing systems which does need to be taken care of explicitly in the > Vim C code, and that is the fact that every letter of those writing > systems may have up to four different shapes depending on its > position in the word and on what letter precedes it if it isn't at > the start of a word. For each of those letters, Vim has to know where > to find the appropriate presentation form depending on context. IIUC > that is done by mean of a look-up table. > > In addition, when alif immediately follows lam a combined laamalif > glyph MUST be used; it has two forms (isolated and final) and, like > ordinary alif, never joins to the next letter in the word. If similar > "obligatory digraphs" exist for "special letters" used only by > languages other than Arabic and maybe Persian, the appropriate code > will have to be written to cater for them. At the moment Vim does not > produce that laamaliph glyph if anything, even a fatha, comes between > the lam and alif in the memory representation of the text. That's not uncommon in Farsi handwriting to reshape `laamalif`, But It's not a language standard. Actually I couldn't remember any Farsi font that not reshape `laamalif`. Because `laam` and `alif` use same character code, I think, It won't be possible to reshape somewhere and don't reshape elsewhere. The shape you can see in [1] is very common in Farsi too, as you can see in [2]. > I don't know of any patches not yet brought into the Vim code about > this issue, except maybe patches sent as attachment to a previous > email in this old thread, and which would have fallen off the radar; > but I'm just a user of Arabic script (and other scripts); I have been > one of Nadim's "guinea pigs" but he's the writer and maintainer of > the Arabic module and if anyone knows the real status of the matter, > it's him. > > > Best regards, > Tony. I liked the approach he continued -current arabic.c is ugly and also made some harmless false assertion/assumptions- but to assure of not breaking current codebase for handling Arabic, I applied this patch [3] over existing code. It works fine because just 4 letters exist in Farsi but not Arabic and two characters have different shaping. So I didn't change algorithm and data structure used for Arabic language. 1: http://en.wikibooks.org/wiki/Arabic/LearnRW/laam-alif 2: http://fa.wikipedia.org/wiki/%D9%84%D8%A7 3: http://www.reith.ir/sc/vim-7.3-arabic-farsi-unicode.patch -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
