Vim, Arabic, mlterm, OS X
I am trying to do the following:
1. edit Arabic script on OSX, running vim in an mlterm
2. and use my own Arabic keymap
As I understand the situation, you need to run non-gvim vim in an mlterm
to get true bidi behavior.
So far I haven't quite got it right. I'm a beginner to vim and mlterm, and
any advice or correction would be much appreciated.
Here's what I've done so far. I'm running OS X version 10.4.8.
a. installed new Xcode
b. installed new MacPorts (formerly DarwinPorts)
c. using MacPorts, and instructions from Nadim Shaikli 1 May 2002 in "mlterm -
the holy grail",
I installed fribidi (0.10.7)
sudo port install mlterm +bidi
(this MacPorts command installs mlterm with --enable-fribidi)
I can now bring up an mlterm
$ mlterm -E utf8 -w 20
with good general results for Latin scripts.
d. Fonts for Arabic
I installed 10x20.bdf and 10x21.pcf in /usr/X11R6/lib/X11/fonts/arabic/
Then I cd'ed to that directory and ran
xset fp+ `pwd`
xset fp rehash
The created file /usr/X11R6/lib/X11/fonts/arabic/fonts.dir contains
is found by running
Question: can anyone tell me what the "arabeyes" font is?
e. using MacPorts again, I installed vim
sudo port install vim +multibyte +huge
(this results in a vim with +arabic support, which I can conform by running
:version. I've got 7.0 with patches 1-178)
I can launch mlterm
$ mlterm -E utf8 -w 20
and then, inside mlterm, launch this vim 7.0. Seems to work fine for Roman
scripts. I can also use my own keymaps, stored in the usual ~/.vim/keymap/
directory, for Roman scripts.
f. Again, I want to edit Arabic script, while running vim in mlterm,
so I added the following
to my .vimrc
There may well be problems here.
" FOR ARABIC (in mlterm)
" setting termbidi means "I'm using mlterm", so mlterm is responsible
" bidi and arabic shaping (Is this right?)
" set the overall direction of the text??
" set rightleft
" set norightleft
" N.B. the following shold be ignored with using mlterm (set termbidi) Right?
" set arabicshape
" the mlterm will take care of the shaping
"my locale is already UTF-8
" I'll be using my own keymap most of the time
" needed for non-GUI (mlterm)??? I've tried both, so far without success
" this font is in /usr/X11R6/lib/X11/fonts/arabic/
" I put them there and
" cd /usr/X11R6/lib/X11/fonts/arabic/
" sudo mkfontdir
" xset fp+ `pwd`
" xset fp rehash
" to set a set of fonts, instead of using 'set guifont'
"set guifontset=firstfont, secondfont
" end of selection from .vimrc
When I launch vim, inside mlterm, I can do
to use the built-in keymap (based on the Microsoft Windows keyboard
layout for Arabic) or even choose my own keymap
and when I type, the display goes right to left, but I get empty
rectangles displayed instead of Arabic glyphs. Oddly enough, I DO see
diacritics like fatHa, Damma and kasra, displayed above and below the
rectangles, but not the main letter glyphs.
1. Am I setting the font correctly? I.e. do I set guifont even if
I'm not using the GUI version?
2. Is there something different or special about setting the font on OS X?
3. Anything else obviously wrong?
Again, I'm a newbie, and I've been trying to get this to work for days. Any
help would be much appreciated. Thanks in anticipation,