Typing Persian (Farsi) in Vim

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Typing Persian (Farsi) in Vim

Ali Majdzadeh-2

Hello All
I want to type Persian in Vim, under both Windows and Linux. Could
anyone please help me? By the way, I use the console version of Vim.

Best Regards
Ali
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Typing Persian (Farsi) in Vim

Tony Mechelynck

Ali Majdzadeh wrote:
> Hello All
> I want to type Persian in Vim, under both Windows and Linux. Could
> anyone please help me? By the way, I use the console version of Vim.
>
> Best Regards
> Ali

With the console version, it may or may not be possible to _display_ Persian
characters, depending on the underlying terminal. For "strange" writing
systems, or for any mixing of several writing systems (such as Arabic
[including Persian], Hebrew, Nagari, Chinese ideograms [for Chinese, Japanese
and/or South Korean], kana [for Japanese], hangeul [for South and North
Korean] and others, as well as any variant of Latin, in any combination), I
recommend using gvim (which frees you from any constraints imposed by a
terminal console, and lets you work identically on any platform) and UTF-8
(which allows, in a single character encoding, all writing systems known to man).

See:
        :help farsi.txt
        :help arabic.txt
        http://vim.wikia.com/wiki/Working_with_Unicode
        http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI
        http://www.vim.org/scripts/script.php?script_id=789
                (Switching to Unicode in an orderly manner)

The only advantage of running in a console would be if it were a "true bidi"
terminal, handling, outside of Vim, the display of mixed left-to-right and
right-to-left character strings on the same line (and the strange cursor moves
that that implies), as well as Arabic "presentation forms" (i.e., the
characters changing shape according to their position in a word); see
        :help 'termbidi'

For entering characters not on your keyboard, see:
        :help i_CTRL-V_digit
        :help digraph.txt
        :help mbyte-keymap
If your locale is non-Latin, you may also have a look at
        :help 'langmap'

You may also (if the existing keymaps are not to your liking) write your own
keymap, as I did twice for my private use, one for Russian and one for Arabic
(these keymaps of mine probably use too much dead keys for general
consumption, but they are more suited to my "form of memory" and to my Latin
fr_BE keyboard than those available with Vim).

See:
        :help keymap-file-format
        http://vim.wikia.com/wiki/How_to_make_a_keymap


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
183. You move your coffeemaker next to your computer.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Typing Persian (Farsi) in Vim

Ali Majdzadeh-2
Tony,
Thanks for your attention. I will try what you said.
Thanks again.

Kind Regards
Ali

2007/12/25, Tony Mechelynck <[hidden email]>:

Ali Majdzadeh wrote:
> Hello All
> I want to type Persian in Vim, under both Windows and Linux. Could
> anyone please help me? By the way, I use the console version of Vim.
>
> Best Regards
> Ali

With the console version, it may or may not be possible to _display_ Persian
characters, depending on the underlying terminal. For "strange" writing
systems, or for any mixing of several writing systems (such as Arabic
[including Persian], Hebrew, Nagari, Chinese ideograms [for Chinese, Japanese
and/or South Korean], kana [for Japanese], hangeul [for South and North
Korean] and others, as well as any variant of Latin, in any combination), I
recommend using gvim (which frees you from any constraints imposed by a
terminal console, and lets you work identically on any platform) and UTF-8
(which allows, in a single character encoding, all writing systems known to man).

See:
        :help farsi.txt
        :help arabic.txt
         http://vim.wikia.com/wiki/Working_with_Unicode
        http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI
         http://www.vim.org/scripts/script.php?script_id=789
                (Switching to Unicode in an orderly manner)

The only advantage of running in a console would be if it were a "true bidi"
terminal, handling, outside of Vim, the display of mixed left-to-right and
right-to-left character strings on the same line (and the strange cursor moves
that that implies), as well as Arabic "presentation forms" (i.e., the
characters changing shape according to their position in a word); see
        :help 'termbidi'

For entering characters not on your keyboard, see:
        :help i_CTRL-V_digit
        :help digraph.txt
        :help mbyte-keymap
If your locale is non-Latin, you may also have a look at
        :help 'langmap'

You may also (if the existing keymaps are not to your liking) write your own
keymap, as I did twice for my private use, one for Russian and one for Arabic
(these keymaps of mine probably use too much dead keys for general
consumption, but they are more suited to my "form of memory" and to my Latin
fr_BE keyboard than those available with Vim).

See:
        :help keymap-file-format
         http://vim.wikia.com/wiki/How_to_make_a_keymap


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
183. You move your coffeemaker next to your computer.





--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Typing Persian (Farsi) in Vim

Felipe Vieira
In reply to this post by Ali Majdzadeh-2
Hey guys,

I have tried the above solution and the following:

http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html

Still can't get Farsi to work. I get those "<200d>" characters.

I have tried gvim with

    :set guifont=Courier\ New\ 10

For instance.

Website for example:

http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html

It displays nicely on my firefox.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Typing Persian (Farsi) in Vim

Bram Moolenaar

Felipe Vieira wrote:

> I have tried the above solution and the following:
>
> http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html
>
> Still can't get Farsi to work. I get those "<200d>" characters.
>
> I have tried gvim with
>
>     :set guifont=Courier\ New\ 10
>
> For instance.
>
> Website for example:
>
> http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html
>
> It displays nicely on my firefox.

The Farsi support in Vim is outdated.  It doesn't work with Unicode.
We are waiting for someone to re-implement it, or merge it with the
Arabic support.

--
Eight Megabytes And Continually Swapping.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.