Skip to content

Latest commit

 

History

History
629 lines (596 loc) · 20.9 KB

README.org

File metadata and controls

629 lines (596 loc) · 20.9 KB

Qwerty Everywhere

Introduction

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.

Installation

You can install all files just by doing

make install

Otherwise you can follow the following instructions to understand the process in each editor.

Emacs

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.

Vim

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

Languages

Arabic

Table

KeyUnicodeArabicName
a0627اALEF
A0649ىALEF MAKSURA
~a0622آALEF WITH MADDA ABOVE
‘a0623أALEF with HAMZA ABOVE
‘i0625إALEF with HAMZA BELOW
-a0671ٱALEF WASLA
b0628بBEH
p067eپPEH
t062aتTEH
.t062bثTHEH
j062cجJEEM
H062dحHAH
x062eخKHAH
%h0686چTCHEH
^h0685څHAH WITH THREE DOTS ABOVE
d062fدDAL
.d0630ذTHAL
z0632زZAIN
r0631رREH
.s0634شSHEEN
s0633سSEEN
c0635صSAD
.c0636ضDAD
D0636ضDAD
Z0638ظZAH
.T0638ظZAH
T0637طTAH
g063aغGHAIN
e0639عAIN
q0642قQAF
f0641فFEH
k0643كKAF
l0644لLAM
m0645مMEEM
n0646نNOON
h0647هHEH
:h0629ةTEH MARBUTA
w0648وWAW
‘w0624ؤWAW with HAMZA ABOVE
y064aيYEH
‘y0626ئYEH with HAMZA ABOVE
00660٠Arabic-Indic digit 0
10661١Arabic-Indic digit 1
20662٢Arabic-Indic digit 2
30663٣Arabic-Indic digit 3
40664٤Arabic-Indic digit 4
50665٥Arabic-Indic digit 5
60666٦Arabic-Indic digit 6
70667٧Arabic-Indic digit 7
80668٨Arabic-Indic digit 8
90669٩Arabic-Indic digit 9
^0651ّSHADDA
0621ءHAMZA
oo0652ْSUKUN
.a064eَFATHA
aN064bًFATHATAN
u064fُDAMMA
.u064fُDAMMA
uN064cٌDAMMATAN
i0650ِKASRA
.i0650ِKASRA
iN064dٍKASRATAN
;061b؛Arabic Semicolon
_0640ـTATWEEL
,060c،Arabic Comma
?061f؟Arabic Question Mark
_Afdf2Allah
_SfdfaSALLALLAHOU ALAYHE WASALLAM

Hebrew

Table

KeyUnicodeHebrewName
a5d0אalef
v5d1בbet
.vfb31bet
bfb31bet
g5d2גgimel
.gfb32gimel
jfb32gimel
d5d3דdalet
.dfb33dalet with dagesh
h5d4הhe
w5d5וvav
z5d6זzayin
H5d7חhet
T5d8טtet
y5d9יyod
x5dbכkaf
kfb3bkaf
X5daךfinal kaf
Kfb3afinal kaf
l5dcלlamed
m5deמmem
M5ddםfinal mem
n“5e0”נnun
N5dfןfinal nun
c“5e1”סsamekh
.cfb41samekh + dagesh
e“5e2”עayin
f“5e4”פpe
pfb44pe + dagesh
F“5e3”ףfinal pe
Pfb43final fe + dagesh
;t“5e6”צtsadi
;T“5e5”ץfinal tsadi
q“5e7”קqof
r“5e8”רresh
s“5e9”שshin
.sfb2ashin
Sfb2bshin
t5eaתtav
.tfb4atav
_:5b0ְsheva
_E5b1ֱhataf segol
_A5b2ֲhataf patah
_O5b3ֳhataf qamats
i5b4ִhiriq
_Y5b5ֵtsere
E5b6ֶsegol
AA5b7ַpatah
AO5b8ָqamats
o5b9ֹholam
u5bbֻqubuts
D5bcּdagesh
]T5bdֽmeteg
]Q5be־maqaf
]R5bfֿrafe
]p5c0׀paseq
]SR5c1ׁshin-dot
]SL5c2ׂsin-dot
]P5c3׃sof-pasuq
VV5f0װdouble vav
VY5f1ױvav-yod
YY5f2ײdouble yod

Phoenician

Table

KeyUnicodePhoenicianName
a010900𐤀alf
b010901𐤁bet
v010901𐤁bet
g010902𐤂gaml
d010903𐤃delt
h010904𐤄he
w010905𐤅wau
z010906𐤆zai
H010907𐤇het
T010908𐤈tet
y010909𐤉yod
x01090a𐤊kaf
k01090a𐤊kaf
l01090b𐤋lamd
m01090c𐤌mem
n01090d𐤍nun
c01090e𐤎semk
e01090f𐤏ain
p010910𐤐pe
f010910𐤐pe
;t010911𐤑sade
q010912𐤒qof
r010913𐤓rosh
s010914𐤔shin
.s010914𐤔shin
S010914𐤔shin
t010915𐤕tau
1010916𐤖one
10010917𐤗ten
20010918𐤘twenty
100010919𐤙one hundred
201091a𐤚two
301091b𐤛three
:01091f𐤟separator

Russian

The code

We are going to write the table to keymaps converters in emacs lisp, which is a dialect of lisp that runs the emacs editor.

Vim

First of all we write a function to convert a like such as

Z0638ظ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")))

Emacs

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)))

Arabic

Emacs

(keymap-to-emacs-quail 'arabic-qwerty-everywhere "arabic" "عربية" (cdr tbl))

vim

(with-temp-buffer
  (keymap-to-vim "arabic-qwerty-everywhere" (cdr tbl))
  (write-file "dist/arabic-qwerty-everywhere.vim"))

Hebrew

Emacs

(keymap-to-emacs-quail 'hebrew-qwerty-everywhere "hebrew" "עברית" (cdr tbl))

vim

(with-temp-buffer
  (keymap-to-vim "hebrew-qwerty-everywhere" (cdr tbl))
  (write-file "dist/hebrew-qwerty-everywhere.vim"))

Phoenician

Emacs

(keymap-to-emacs-quail 'phoenician-qwerty-everywhere "phoenician" "phoenician" (cdr tbl))

vim

(with-temp-buffer
  (keymap-to-vim "phoenician-qwerty-everywhere" (cdr tbl))
  (write-file "dist/phoenician-qwerty-everywhere.vim"))

References

bibliographystyle:unsrt bibliography:README.bib

Bibtex entries

@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},
}