This projects aims to make writing Arabic, Hebrew, Phoenician and Russian
easier in Emacs and Vim by defining an intuitive keymap for QWERTY
users. If you are using another editor or want to contribute
a language, you are welcome to contribute.
This is a living document to try to find the most intuitive and easy to learn keymap for the languages found herein.
This document is written in the form of a literate program, which produces the code in a self-contained way in the same document cite:LiteratePrograKnuth1984,Literate.prograRamsey1994.
You can install all files just by doing
make install
Otherwise you can follow the following instructions to understand the process in each editor.
Copy the file you want from the dist folder somewhere in your computer.
For instance, if you choose the arabic version of qwerty-everywhere
and you copy it into the path ~~/.emacs.d/arabic-qwerty-everywhere.el~,
add the followint into you ~~/.emacs.d/init.el~ file
(load "~/.emacs.d/arabic-qwerty-everywhere.el")
and now you can set this keymap by M-x set-input-method
and choosing the arabic-qwerty-everywhere
.
Copy the file you want from the dist folder to ~~/.vim/keymaps/~ and activate the keymap by doing
:set keymap=arabic-qwerty-everywhere
:set rightleft
in the case that you chose the arabic version. You can go back to your default by doing
:set keymap
:set norightleft
Key | Unicode | Arabic | Name |
---|---|---|---|
a | 0627 | ا | ALEF |
A | 0649 | ى | ALEF MAKSURA |
~a | 0622 | آ | ALEF WITH MADDA ABOVE |
‘a | 0623 | أ | ALEF with HAMZA ABOVE |
‘i | 0625 | إ | ALEF with HAMZA BELOW |
-a | 0671 | ٱ | ALEF WASLA |
b | 0628 | ب | BEH |
p | 067e | پ | PEH |
t | 062a | ت | TEH |
.t | 062b | ث | THEH |
j | 062c | ج | JEEM |
H | 062d | ح | HAH |
x | 062e | خ | KHAH |
%h | 0686 | چ | TCHEH |
^h | 0685 | څ | HAH WITH THREE DOTS ABOVE |
d | 062f | د | DAL |
.d | 0630 | ذ | THAL |
z | 0632 | ز | ZAIN |
r | 0631 | ر | REH |
.s | 0634 | ش | SHEEN |
s | 0633 | س | SEEN |
c | 0635 | ص | SAD |
.c | 0636 | ض | DAD |
D | 0636 | ض | DAD |
Z | 0638 | ظ | ZAH |
.T | 0638 | ظ | ZAH |
T | 0637 | ط | TAH |
g | 063a | غ | GHAIN |
e | 0639 | ع | AIN |
q | 0642 | ق | QAF |
f | 0641 | ف | FEH |
k | 0643 | ك | KAF |
l | 0644 | ل | LAM |
m | 0645 | م | MEEM |
n | 0646 | ن | NOON |
h | 0647 | ه | HEH |
:h | 0629 | ة | TEH MARBUTA |
w | 0648 | و | WAW |
‘w | 0624 | ؤ | WAW with HAMZA ABOVE |
y | 064a | ي | YEH |
‘y | 0626 | ئ | YEH with HAMZA ABOVE |
0 | 0660 | ٠ | Arabic-Indic digit 0 |
1 | 0661 | ١ | Arabic-Indic digit 1 |
2 | 0662 | ٢ | Arabic-Indic digit 2 |
3 | 0663 | ٣ | Arabic-Indic digit 3 |
4 | 0664 | ٤ | Arabic-Indic digit 4 |
5 | 0665 | ٥ | Arabic-Indic digit 5 |
6 | 0666 | ٦ | Arabic-Indic digit 6 |
7 | 0667 | ٧ | Arabic-Indic digit 7 |
8 | 0668 | ٨ | Arabic-Indic digit 8 |
9 | 0669 | ٩ | Arabic-Indic digit 9 |
^ | 0651 | ّ | SHADDA |
‘ | 0621 | ء | HAMZA |
oo | 0652 | ْ | SUKUN |
.a | 064e | َ | FATHA |
aN | 064b | ً | FATHATAN |
u | 064f | ُ | DAMMA |
.u | 064f | ُ | DAMMA |
uN | 064c | ٌ | DAMMATAN |
i | 0650 | ِ | KASRA |
.i | 0650 | ِ | KASRA |
iN | 064d | ٍ | KASRATAN |
; | 061b | ؛ | Arabic Semicolon |
_ | 0640 | ـ | TATWEEL |
, | 060c | ، | Arabic Comma |
? | 061f | ؟ | Arabic Question Mark |
_A | fdf2 | ﷲ | Allah |
_S | fdfa | ﷺ | SALLALLAHOU ALAYHE WASALLAM |
Key | Unicode | Hebrew | Name |
---|---|---|---|
a | 5d0 | א | alef |
v | 5d1 | ב | bet |
.v | fb31 | בּ | bet |
b | fb31 | בּ | bet |
g | 5d2 | ג | gimel |
.g | fb32 | גּ | gimel |
j | fb32 | גּ | gimel |
d | 5d3 | ד | dalet |
.d | fb33 | דּ | dalet with dagesh |
h | 5d4 | ה | he |
w | 5d5 | ו | vav |
z | 5d6 | ז | zayin |
H | 5d7 | ח | het |
T | 5d8 | ט | tet |
y | 5d9 | י | yod |
x | 5db | כ | kaf |
k | fb3b | כּ | kaf |
X | 5da | ך | final kaf |
K | fb3a | ךּ | final kaf |
l | 5dc | ל | lamed |
m | 5de | מ | mem |
M | 5dd | ם | final mem |
n | “5e0” | נ | nun |
N | 5df | ן | final nun |
c | “5e1” | ס | samekh |
.c | fb41 | סּ | samekh + dagesh |
e | “5e2” | ע | ayin |
f | “5e4” | פ | pe |
p | fb44 | פּ | pe + dagesh |
F | “5e3” | ף | final pe |
P | fb43 | ףּ | final fe + dagesh |
;t | “5e6” | צ | tsadi |
;T | “5e5” | ץ | final tsadi |
q | “5e7” | ק | qof |
r | “5e8” | ר | resh |
s | “5e9” | ש | shin |
.s | fb2a | שׁ | shin |
S | fb2b | שׂ | shin |
t | 5ea | ת | tav |
.t | fb4a | תּ | tav |
_: | 5b0 | ְ | sheva |
_E | 5b1 | ֱ | hataf segol |
_A | 5b2 | ֲ | hataf patah |
_O | 5b3 | ֳ | hataf qamats |
i | 5b4 | ִ | hiriq |
_Y | 5b5 | ֵ | tsere |
E | 5b6 | ֶ | segol |
AA | 5b7 | ַ | patah |
AO | 5b8 | ָ | qamats |
o | 5b9 | ֹ | holam |
u | 5bb | ֻ | qubuts |
D | 5bc | ּ | dagesh |
]T | 5bd | ֽ | meteg |
]Q | 5be | ־ | maqaf |
]R | 5bf | ֿ | rafe |
]p | 5c0 | ׀ | paseq |
]SR | 5c1 | ׁ | shin-dot |
]SL | 5c2 | ׂ | sin-dot |
]P | 5c3 | ׃ | sof-pasuq |
VV | 5f0 | װ | double vav |
VY | 5f1 | ױ | vav-yod |
YY | 5f2 | ײ | double yod |
Key | Unicode | Phoenician | Name |
---|---|---|---|
a | 010900 | 𐤀 | alf |
b | 010901 | 𐤁 | bet |
v | 010901 | 𐤁 | bet |
g | 010902 | 𐤂 | gaml |
d | 010903 | 𐤃 | delt |
h | 010904 | 𐤄 | he |
w | 010905 | 𐤅 | wau |
z | 010906 | 𐤆 | zai |
H | 010907 | 𐤇 | het |
T | 010908 | 𐤈 | tet |
y | 010909 | 𐤉 | yod |
x | 01090a | 𐤊 | kaf |
k | 01090a | 𐤊 | kaf |
l | 01090b | 𐤋 | lamd |
m | 01090c | 𐤌 | mem |
n | 01090d | 𐤍 | nun |
c | 01090e | 𐤎 | semk |
e | 01090f | 𐤏 | ain |
p | 010910 | 𐤐 | pe |
f | 010910 | 𐤐 | pe |
;t | 010911 | 𐤑 | sade |
q | 010912 | 𐤒 | qof |
r | 010913 | 𐤓 | rosh |
s | 010914 | 𐤔 | shin |
.s | 010914 | 𐤔 | shin |
S | 010914 | 𐤔 | shin |
t | 010915 | 𐤕 | tau |
1 | 010916 | 𐤖 | one |
10 | 010917 | 𐤗 | ten |
20 | 010918 | 𐤘 | twenty |
100 | 010919 | 𐤙 | one hundred |
2 | 01091a | 𐤚 | two |
3 | 01091b | 𐤛 | three |
: | 01091f | 𐤟 | separator |
We are going to write the table to keymaps converters in emacs lisp, which is a dialect of lisp that runs the emacs editor.
First of all we write a function to convert a like such as
Z 0638 ظ ZAH
into the vim format for keymaps
Z <char-0x0638>
This means, we only need the key and the hexadecimal unicode. The function for this is `keymap-line-to-vim`
(defun keymap-line-to-vim (line)
"Example of a line:
| Z | 0638 | ظ | ZAH | ⇒ Z <char-0x0638> \" ظ - ZAH
"
(let ((key (first line))
(code (second line))
(symbol (third line))
(name (fourth line)))
(format "%s <char-0x%s> \" %s - %s"
key code symbol name)))
For the whole table, we will assume that we are in a temporary buffer and we can insert text into it, then we can write directly the buffer to a file or retrieve the string. This greatly simplifies the code in emacs:
(defun keymap-to-vim (name table)
(insert (format "let b:keymap_name = \"%s\"\n"
name))
(insert "loadkeymap\n")
(insert (string-join (mapcar #'keymap-line-to-vim table) "\n")))
Since lisp is a homoiconic language we can actually create directly
lisp code that will be loaded into emacs. For this we first create
key-value pairs for each letters in the keymap-line-to-emacs-quail
function and we wrap everything in a progn
block to define a quail
package.
(defun keymap-line-to-emacs-quail (line)
`(,(format "%s" (first line))
,(string-to-number (format "%s" (second line)) 16)))
(defun keymap-to-emacs-quail (name language title table)
`(progn
(require 'quail)
(quail-define-package ,(symbol-name name) ,language ,title)
(quail-define-rules
,@(mapcar #'keymap-line-to-emacs-quail table))
(provide ',name)))
(keymap-to-emacs-quail 'arabic-qwerty-everywhere "arabic" "عربية" (cdr tbl))
(with-temp-buffer
(keymap-to-vim "arabic-qwerty-everywhere" (cdr tbl))
(write-file "dist/arabic-qwerty-everywhere.vim"))
(keymap-to-emacs-quail 'hebrew-qwerty-everywhere "hebrew" "עברית" (cdr tbl))
(with-temp-buffer
(keymap-to-vim "hebrew-qwerty-everywhere" (cdr tbl))
(write-file "dist/hebrew-qwerty-everywhere.vim"))
(keymap-to-emacs-quail 'phoenician-qwerty-everywhere "phoenician" "phoenician" (cdr tbl))
(with-temp-buffer
(keymap-to-vim "phoenician-qwerty-everywhere" (cdr tbl))
(write-file "dist/phoenician-qwerty-everywhere.vim"))
bibliographystyle:unsrt bibliography:README.bib
@article{LiteratePrograKnuth1984,
author = {Knuth, D. E.},
doi = {10.1093/comjnl/27.2.97},
issn = {0010-4620},
issue = {2},
journal = {The Computer Journal},
language = {en},
month = {2},
pages = {97--111},
publisher = {Oxford University Press (OUP)},
title = {Literate Programming},
type = {article},
url = {http://dx.doi.org/10.1093/comjnl/27.2.97},
volume = {27},
year = {1984},
}
@article{Literate.prograRamsey1994,
author = {Ramsey, N.},
doi = {10.1109/52.311070},
issue = {5},
journal = {IEEE Software},
month = {9},
pages = {97--105},
publisher = {Institute of Electrical and Electronics Engineers (IEEE)},
title = {Literate programming simplified},
type = {article},
url = {http://dx.doi.org/10.1109/52.311070},
volume = {11},
year = {1994},
}