Typing Persian (Farsi) in Vim

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Typing Persian (Farsi) in Vim

Bahman Eslami
Bram and Tony,

I found the problem! :) In short the solution was to 'set termbidi' in the vimrc file and I had to remove any vim configuration files and folders. Previously my vim was acting so strangely when I built it using brew and was typing Persian and it was inserting question marks. To fix it I deleted the .vim folder and and also the .vimrc file and build the vim from scratch. So I got a fresh vim install, then I started to try the solutions Tony described, because what you said made me realise I was doing something different from you. So the problem I guess was vim not recognising the terminal. Now it’s working great just like I expect it when I ’set termbidi’ in the vimrc file. I couldn’t make it work in the iTerm though which is not a bidi terminal. Sorry for taking you time again. 

Thanks a lot,
Bahman

On 1 Dec 2018, at 11:50, Bram Moolenaar <[hidden email]> wrote:


Bahman Eslami wrote:

Sorry for late reply and also taking your time on this,

Tony:
I added the configuration as you mentioned. After that when I typed Persian everything got typed as question marks and still as before every character I typed resulted in more than one character. So I still prefer to have the feature ‘arabic’ and ‘persian’ off. Sorry but thanks!

Bram:
Maybe I didn't understand you question correctly? I cloned the vim
from GitHub and without any changes to the source if I build it using
the ‘huge’ feature, it includes +arabic and +farsi. Even if I use
homebrew to install it I get those features. According to this
<http://www.drchip.org/astronaut/vim/vimfeat.html> vim includes
‘farsi' and ‘arabic' in the ‘huge' features. I don’t explicitly add
‘arabic’ nor ‘farsi’ since I don’t know how it’s done without changing
the feature and config file in the src. I hope this answered the
question.

Yes, I understand that your Vim is build with +arabic and +farsi.  That
is fine, I also build with these features.

The question is: When Vim has these features, what is different from a
Vim without these features?  Both Vim binaries should do exactly the
same thing, unless you set options such as 'arabic' and 'fkmap'.  Are
these options set automatically for you perhaps?  Try this:

verbose set arabic? fkmap?

Or just try disabling them:

verbose set noarabic norightleft nofkmap


--
LETTERS TO THE EDITOR (The Times of London)

Dear Sir,

I am firmly opposed to the spread of microchips either to the home or
to the office.  We have more than enough of them foisted upon us in
public places.  They are a disgusting Americanism, and can only result
in the farmers being forced to grow smaller potatoes, which in turn
will cause massive unemployment in the already severely depressed
agricultural industry.

Yours faithfully,
        Capt. Quinton D'Arcy, J. P.
        Sevenoaks

/// 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.
Reply | Threaded
Open this post in threaded view
|

Re: Typing Persian (Farsi) in Vim

Tony Mechelynck
On Sun, Dec 2, 2018 at 3:40 AM Bahman Eslami <[hidden email]> wrote:
>
> Bram and Tony,
>
> I found the problem! :) In short the solution was to 'set termbidi' in the vimrc file and I had to remove any vim configuration files and folders. Previously my vim was acting so strangely when I built it using brew and was typing Persian and it was inserting question marks. To fix it I deleted the .vim folder and and also the .vimrc file and build the vim from scratch. So I got a fresh vim install, then I started to try the solutions Tony described, because what you said made me realise I was doing something different from you. So the problem I guess was vim not recognising the terminal. Now it’s working great just like I expect it when I ’set termbidi’ in the vimrc file. I couldn’t make it work in the iTerm though which is not a bidi terminal. Sorry for taking you time again.

Indeed, full-bidi (e.g. displaying on the same line Arabic-script text
in RTL direction and Latin-script text in LTR) is not possible in Vim
alone, even if compiled with +rightleft and +arabic, it needs
cooperation of a full-bidi-capable terminal, and it needs to know that
the terminal can display full-bidi text (the latter is the /raison
d'être/ of the 'termbidi' option). When Vim is not running in a
full-bidi terminal, it can display all text in either LTR or RTL, even
both in /different/ windows displaying the same file, but not both in
the same window. I'm happy to know that you finally made it work.
>
> Thanks a lot,
> Bahman

You're welcome, and Best regards,
Tony.

>
> On 1 Dec 2018, at 11:50, Bram Moolenaar <[hidden email]> wrote:
>
>
> Bahman Eslami wrote:
>
> Sorry for late reply and also taking your time on this,
>
> Tony:
> I added the configuration as you mentioned. After that when I typed Persian everything got typed as question marks and still as before every character I typed resulted in more than one character. So I still prefer to have the feature ‘arabic’ and ‘persian’ off. Sorry but thanks!
>
> Bram:
> Maybe I didn't understand you question correctly? I cloned the vim
> from GitHub and without any changes to the source if I build it using
> the ‘huge’ feature, it includes +arabic and +farsi. Even if I use
> homebrew to install it I get those features. According to this
> <http://www.drchip.org/astronaut/vim/vimfeat.html> vim includes
> ‘farsi' and ‘arabic' in the ‘huge' features. I don’t explicitly add
> ‘arabic’ nor ‘farsi’ since I don’t know how it’s done without changing
> the feature and config file in the src. I hope this answered the
> question.
>
>
> Yes, I understand that your Vim is build with +arabic and +farsi.  That
> is fine, I also build with these features.
>
> The question is: When Vim has these features, what is different from a
> Vim without these features?  Both Vim binaries should do exactly the
> same thing, unless you set options such as 'arabic' and 'fkmap'.  Are
> these options set automatically for you perhaps?  Try this:
>
> verbose set arabic? fkmap?
>
> Or just try disabling them:
>
> verbose set noarabic norightleft nofkmap
>
>
> --
> LETTERS TO THE EDITOR (The Times of London)
>
> Dear Sir,
>
> I am firmly opposed to the spread of microchips either to the home or
> to the office.  We have more than enough of them foisted upon us in
> public places.  They are a disgusting Americanism, and can only result
> in the farmers being forced to grow smaller potatoes, which in turn
> will cause massive unemployment in the already severely depressed
> agricultural industry.
>
> Yours faithfully,
>         Capt. Quinton D'Arcy, J. P.
>         Sevenoaks
>
> /// 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.
12