Search the web
Sign In
New User? Sign Up
vim · Vim (Vi IMproved) text editor users list
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
UTF bidi support   Message List  
Reply | Forward Message #105562 of 109209 |
Re: UTF bidi support


On 03/07/09 21:05, J.A.J. Pater wrote:
> Bram Moolenaar wrote:
> > The display is not the only part. Suppose you move your cursor to the
> > start of a word and type "dw". You expect the word to be deleted.
> > Since "start of the word" depends on what direction the word is to be
> > read, the editor needs to understand the meaning of the word to be able
> > to decide what to do. And it gets worse: What if some of the characters
> > in the word are LTR and some are RTL? This quickly gets very
> > complicated.
> >
> > So Vim uses a simple and reliable method: Display the text either as LTR
> > or RTL and do the editing assuming all text is to be read that way.
>
> These are good reason for gvim to work the way its works!
> So this editing 'mode' should be default.
>
> But it still would be nice if there would be an optional 'real-bidi mode'.
>
> > It would be really messy to display the text with mixed directions and
> > then have all edits work one way or perhaps fail with an error.
>
> Using the ViGedit plugin for gedit I'm also able to do some real-bidi
> typing. :-)
> Works almost the same as "mlterm+vim+set termbidi"
> With an exception: in command mode the h always goes left, the l always
> goes right, just as I want it.
> (It just feels weird pressing h and cursor goes right).

Hm, I think it's one of those things one could get used to in time, no
harder than deleting with d rather than Ctrl-X, pasting with P rather
than Ctrl-V, and copying with y rather than Ctrl-C. I know there is
mswin.vim for the latter three, but IMO it is the result of a misguided
attempt to make Vim more like Notepad. Indeed, in true-bidi terminals
with 'termbidi' on (which should be the Vim default for mlterm) Vim has
no knowledge of character direction, so lllll goes uniformly
first-to-last, and hhhhh last-to-first, even if the movement is a little
jerky when meeting a direction change within a line of text. (Or did I
misunderstand? AFAICT I haven't got mlterm installed)

> Indeed as far as I'm concerned a command like "dw" in RTL mode should
> delete from R to L.
>
> Since gedit seems to be real-bidi I guess GTK+ has the algorithm
> mentioned by Ali sort of implemented.
> Guess this could be used in gvim.

My notion would be that a true-bidi gvim should work exactly like
vim+mlterm with 'termbidi'.

>
> Indeed it will be quite hard to figure out how vim commands should work.
> So maybe a 'real-bidi mode' could use only a subset of vim commands?
>
> Well just my 2 cents.
>
> Adriaan


Best regards,
Tony.
--
Meskimen's Law:
There's never time to do it right, but there's always time to
do it over.

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




Sat Jul 4, 2009 9:58 am

antoine.mechelynck@...
Send Email Send Email

Forward
Message #105562 of 109209 |
Expand Messages Author Sort by Date

Dear vimmers, When I open a UTF-text file with right-to-left-text (hebrew in this case) and left-to-right-text (english in this case) in gedit it is rendered...
J.A.J. Pater
jajpater@...
Send Email
Jul 2, 2009
12:13 pm

No, there is no way to do it, I miss this as well... If you only want to view text, I have a plugin for urxvt that does this. Moshe...
Moshe Kamensky
moshe.kamensky@...
Send Email
Jul 2, 2009
1:18 pm

... Would this plugin not work while editing text? I'd like to have it. --~--~---------~--~----~------------~-------~--~----~ You received this message from...
J.A.J. Pater
jajpater@...
Send Email
Jul 3, 2009
11:25 am

... It won't work for editing, because it only works when applying the bidi algorithm once for each line. I attach the plugin. You should put it in the same...
Moshe Kamensky
moshe.kamensky@...
Send Email
Jul 3, 2009
2:24 pm

... No, the whole text is either LTR or RTL. I have never understood why people put the text in the wrong order in the file and then change the order when...
Bram Moolenaar
Bram@...
Send Email
Jul 2, 2009
6:03 pm

... If you put the characters into the file in the order they are displayed regardless of the order they are pronounced, you'll get no end of trouble when...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 3, 2009
2:25 am

... case (IIUC) setting 'termbidi' tells Vim that the terminal, not Vim, is in charge of bidi display, Arabic shaping, etc. OK, thanks! This was the part I...
J.A.J. Pater
jajpater@...
Send Email
Jul 3, 2009
11:33 am

... IIUC that is what bidi mean. The text is in 'correct order' but displayed as bidi. eg. numbers are ltr in arabic, in order to write the sentence...
bill lam
cbill.lam@...
Send Email
Jul 3, 2009
4:14 am

... Well, I thought Bram meant that che characters should be in the file in the order 2 0 0 9 <space> r a e y if it's a "LTR file", and in the order y e a r ...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 3, 2009
5:05 am

... Can you give a reference where Unicode specifies this? ... -- hundred-and-one symptoms of being an internet addict: 54. You start tilting your head...
Bram Moolenaar
Bram@...
Send Email
Jul 3, 2009
6:11 pm

... http://unicode.org/reports/tr9/? Anyway, I don't think storing chars in presentation order is a good idea. Apart from problems when using the file (other...
Ali Gholami Rudi
aliqrudi@...
Send Email
Jul 3, 2009
6:52 pm

... [Tony wrote] ... y e a r <space> 2 0 0 9 ... Yeah, that's one place, though like most of the "normative" Unicode texts it is very much "technical" -- the...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 4, 2009
8:50 am

... They're stored in the file in "logical order", which is the order that the reader processes them when reading. That means, if he has an English document...
Ken Bloom
kbloom@...
Send Email
Jul 3, 2009
3:25 am

... The display is not the only part. Suppose you move your cursor to the start of a word and type "dw". You expect the word to be deleted. Since "start of...
Bram Moolenaar
Bram@...
Send Email
Jul 3, 2009
6:11 pm

... These are good reason for gvim to work the way its works! So this editing 'mode' should be default. But it still would be nice if there would be an...
J.A.J. Pater
jajpater@...
Send Email
Jul 3, 2009
7:06 pm

... Hm, I think it's one of those things one could get used to in time, no harder than deleting with d rather than Ctrl-X, pasting with P rather than Ctrl-V,...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 4, 2009
9:59 am

... Sure one could get used to it! But d(elete) p(aste) y(ank) are sort of intuitive. But it is counter intuitive to use a key which is placed (more to the) ...
J.A.J. Pater
jajpater@...
Send Email
Jul 4, 2009
12:40 pm

... Perhaps their left-right placement leads to user misunderstanding, but I think l should be understood as "next" and h as "previous", so that in a sentence...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 4, 2009
2:35 pm

... Your right when you understand it that way! But it is still counter intuitive ... (Jod-Heh-Vav-Heh) and ALLH ... This is not the case when e.g. using...
J.A.J. Pater
jajpater@...
Send Email
Jul 4, 2009
8:00 pm

... by "_hand_-copying" I meant "with pen and paper", not "by typing". ... Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 63. You...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 4, 2009
9:39 pm

... [...] ... With logical order, the start of a word is the letter which stands earliest in memory. If you move your cursor to the leading alif of Allah,...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 4, 2009
9:43 am

Hi, ... As a workaround, I use this function to make editing files with mixed rtl and ltr words easier: " make right to left editing easier " replace Mylang...
Ali Gholami Rudi
aliqrudi@...
Send Email
Jul 3, 2009
5:36 am

... Thanks for the tip. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information,...
J.A.J. Pater
jajpater@...
Send Email
Jul 3, 2009
11:32 am

... .....................:let &l:imi = !&l:imi.......... no need to clobber the global setting (for 'rl' you properly used :setlocal) ... Best regards, Tony. ...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 4, 2009
10:09 am

... Yep, thanks. Ali --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit...
Ali Gholami Rudi
aliqrudi@...
Send Email
Jul 4, 2009
10:28 am

... I think a bidi vim should have key strokes for both (a set of motion keystrokes that operate in logical order, and a set of keystrokes that operate in...
Ken Bloom
kbloom@...
Send Email
Jul 5, 2009
10:09 pm

... AFAICT, g<Up> and g<Down> are equivalent to gj and gk. I suppose it would be possible to define g<Left> and g<Right> via a future patch implementing...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 5, 2009
10:47 pm

... Then I recommend creating a new branch in the vim Subversion repository, or creating a clone of the repository in git or one of the other distributed...
Ken Bloom
kbloom@...
Send Email
Jul 6, 2009
1:09 am

... My point wasn't to bikeshed specific key combinations at this point, rather it was that a highly extensible editor (such as vim or emacs) would be a good...
Ken Bloom
kbloom@...
Send Email
Jul 6, 2009
1:15 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help