Friday, November 30, 2018

Re: Typing Persian (Farsi) in Vim

Hello,

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 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.

Here is the output from my vim —version installed using Homebrew without any options, just by using 'brew install vim':

VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 24 2018 19:13:03)
macOS version
Included patches: 1-500
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     +tag_old_static
+arabic            +farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    -tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          -toolbar
+cindent           +insert_expand     +path_extra        +user_commands
-clientserver      +job               +perl              +vartabs
+clipboard         +jumplist          +persistent_undo   +vertsplit
+cmdline_compl     +keymap            +postscript        +virtualedit
+cmdline_hist      +lambda            +printer           +visual
+cmdline_info      +langmap           +profile           +visualextra
+comments          +libcall           -python            +viminfo
+conceal           +linebreak         +python3           +vreplace
+cryptv            +lispindent        +quickfix          +wildignore
+cscope            +listcmds          +reltime           +wildmenu
+cursorbind        +localmap          +rightleft         +windows
+cursorshape       +lua               +ruby              +writebackup
+dialog_con        +menu              +scrollbind        -X11
+diff              +mksession         +signs             -xfontset
+digraphs          +modify_fname      +smartindent       -xim
-dnd               +mouse             +startuptime       -xpm
-ebcdic            -mouseshape        +statusline        -xsmp
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_clipboard
+eval              -mouse_gpm         +syntax            -xterm_save
+ex_extra          -mouse_jsbterm     +tag_binary        
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.13 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.5.3 -lobjc    


I have to say the reason I chose vim is its performance and extensibility plus ability to type RTL without hassle which is extremely rare. So I was very excited to see that RTL works in the OSX terminal out of the box.

Best,
Bahman
On 30 Nov 2018, at 01:00, Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:

On Thu, Nov 29, 2018 at 11:31 PM Bram Moolenaar <Bram@moolenaar.net> wrote:
You are missing something.  You can build Vim with the Arabic and/or
Farsi feature, but so long as you don't set the 'arabic' or 'fkmap'
options then nothing should be different.  You haven't answered the
question why anything changes without setting those options.  I always
build with huge features and don't get any Arabic stuff because it's not
enabled by the option.

IIUC, the OP's problem is that mixed RTL and LTR text is not displayed
in full-bidi in Vim (which is a known limitation, but he regards it as
a major bug) but that the Mac native terminal, which calls itself
xterm-256color and not mlterm, displays full-bidi even in Vim, with
correct shaping of Arabic letters, provided that Vim is compiled with
-arabic. (I don't know how it does that, but I'm not on a Mac myself.)
"set termbidi" (which requires +arabic) apparently corrupts the
display, as shown in one of his posts earlier in this thread.

Best regards,
Tony.

No comments:

Post a Comment