6

I can not write a html file in Arabic by vim.

Tried to do the following:

:set arabic
:set rl

or

:set rightleft

or

:set arabicshape

The problem I want to write Arabic without any change on my tags. I want her to go from left to right.

How i can do thos?

Mat
  • 202,337
  • 40
  • 393
  • 406
Tarek Saied
  • 6,482
  • 20
  • 67
  • 111

4 Answers4

7

Vim can be invoked in Arabic mode activated by the following command:

vim -A test1

this will start with the cursor located in the right and ready for Arabic text:

السلام عليكم

-- INSERT Arabic --

source: http://blog.naoar.com/2012/04/vim-and-arabic.html

Bobrovsky
  • 13,789
  • 19
  • 80
  • 130
4

As vim is not BiDi enabled this should not be possible.

But I've been fiddling around a bit and it seems that vim + Konsole (KDE's terminal emulator) seems to do the job if you enable bidirectional support for Konsole. In vim (NO arabic options enabled) you should be able to write LTR and RTL, but letters will always be in isolated form (no shaping). I've found that setting the 'arabicshape' option then unsetting it seems to fix that. Short vowels are not displayed correctly, even though they seem to be written just fine to the file.

I have not tried with other terminal emulators, I'm not aware of their BiDi capabilities. Gnome-terminal maybe ?

G.J
  • 493
  • 4
  • 10
  • thanx a lot for "setting then unsetting" thing! that does the job! do you have any idea how this happens? – sazary Mar 28 '15 at 21:19
2

because I can't comment on G.J I post it as an answer

using vim in konsole and putting set arabicshape! in my .vimrc solved the problem for me

raoof
  • 538
  • 1
  • 6
  • 12
1

as Arabic moves rtl, not ltr, your requirements are contradictory, which is no doubt why it doesn't work.

jwenting
  • 5,505
  • 2
  • 25
  • 30