Loading ...
Sorry, an error occurred while loading the content.

vim, arabic, mlterm, OS X

Expand Messages
  • Kenneth Reid Beesley
    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
    Message 1 of 1 , Dec 28 10:21 AM
    • 0 Attachment
      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)

      and mlterm

      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

      10x20.bdf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
      10x21.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-arabeyes-1

      and -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
      is found by running

      $ xlsfonts

      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
      for handling
      " bidi and arabic shaping (Is this right?)
      set termbidi

      " 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
      set encoding=utf-8

      " I'll be using my own keymap most of the time
      "set keymap=arabicB

      " Font
      " needed for non-GUI (mlterm)??? I've tried both, so far without success
      set guifont=-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
      "set guifont=-misc-fixed-medium-r-normal--20-200-75-75-c-100-arabeyes-1
      " 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
      :set arabic

      to use the built-in keymap (based on the Microsoft Windows keyboard
      layout for Arabic) or even choose my own keymap

      :set keymap=arabicB

      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.

      ************** Questions

      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,

      Ken Beesley
    Your message has been successfully submitted and would be delivered to recipients shortly.