Babiker Osman wrote:
> I am looking for appropriate arabic fonts to integrate
> with vim and how can i set it
The following assumes that you have a gvim version with Arabic support. Try
If the answer is nonzero (normally 1), it's OK. If it's zero, you need to find
a more powerful executable.
Setting the font in gvim means setting the 'guifont' option. This involves
- finding a fixed-width font with Arabic glyphs (Vim cannot use variable-width
- ascertaining how your version of gvim names that font;
- writing the proper line into your vimrc.
In my experience, the Courier New font is one of the rare monospaced fonts
which includes Arabic glyphs. Now *any* monospaced font will make Arabic look
ugly, but ugly is better than nothing.
Another difficulty is that there are several different, incompatible formats
for the 'guifont' version, depending on which GUI flavour is compiled into
Try pasting the following code snippet into your vimrc:
if has("gui_running") " only the GUI can set the font
if has("gui_gtk2") " GTK2 only, not GTK1
set gfn=Courier\ New\ 10
set gfn=Courier\ New:s10
elseif has("gui_kde") " the obsolete kvim
set gfn=Courier\ New/10/-1/5/50/0/0/0/1/0
elseif has("x11") " other X11 GUIs, including GTK1
else " non-X11 GUIs
This should sniff your GUI flavour and set a first-approximation Arabic font.
The next step is checking whether you like the size. You can do this as follows:
1. Start gvim with a vimrc including the above snippet.
to start Insert mode.
3. Type something in Arabic. It should appear near the top right of the
If you want a bigger or smaller size, then hit <Esc> to go back to Normal
mode, and then
where <Tab> means "hit the Tab key". Vim will insert the current 'guifont'
value, with escaping backslashes if and where needed. You may edit it (the
first or only number is the font size), using <Left> and <Right> to move the
cursor, and, after making changes, <Enter> to accept or <Esc> to cancel.
Repeat until you like what you see (apart from the fact that Arabic always
looks ugly in monospace).
Once you have found which size pleases you best, enter the value into your
vimrc by modifying the appropriate line in the code snippet shown above.
See ":help arabic.txt" for more details about the specifics of Arabic editing
A door is what a dog is perpetually on the wrong side of.
-- Ogden Nash
Babiker Osman wrote:
> Thanks Tony for your help
> :echo has("arabic")
> The answer is 1
> I did the pasting however
Did you (re)start gvim with the modified vimrc?
> Vim will insert
> the current 'guifont' value, with escaping ackslashes
> if and where needed.
> Does'nt work
What do you see after:
1) pasting the code snipped I gave you into your vimrc
2) restarting gvim
(where <Tab> is not 5 characters but just hitting Tab)
Your ":set" statement should be filled-in and you should be able to do
command-line edition on it.
> I chose Courier New 10 from vim menu it works
> However when i compile for tex output file is empty
> Best regards
I don't know Tex. What is "compiling for tex output"?
Vim is capable of writing a plaintext file. If you want to pass your current
editfile to a different program, you must
- either save it (using ":w" ot maybe ":saveas <filename>" where <filename> is
any new name under which you want to save the file, then pass the (saved) file
to the external program,
- or invoke the external program as a filter and pass a range of lines to it
(see ":help filter").
The United States is like the guy at the party who gives cocaine to
everybody and still nobody likes him.
-- Jim Samuels