Re: [Vim-latex-devel] Re: [Vim-latex-cvs] vimfiles/plugin imaps.vim,1.7,1.8
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2002-12-08 23:12:41
|
Okay, Benji and Luc have convinced me. Let's get on with the great change :) But before that, I would like to have a little bit of thought about whats the best thing to change these things to. Option 1: change things like '\onlyslides{=AB=BB}=AB=BB' to "\\onlyslides{\xab\xb= b}\xab\xbb" I am wondering however, whether this will create problems with people who use international character sets etc. Ofcourse, now the files themselves will be easily readable, but I wonder if the way "\xab" displays on the screen depends on the locale which the user is currently using etc. A disadvantage of something like this will be that the vim scripts themselves will look pretty ugly with "\xab" kinda things all over the place... Option 2: Change it to something like "\\onlyslides{<++>}<++>" Here the placeholder (or marker) characters are "<+" and "+>". Now the characters (and the vim scripts) will be correctly displayed across all platforms/locales etc. The problem with this approach, ofcourse is that we are using 2 characters instead of 1. This will make the expansions generally longer... Ofcourse, the users can still set g:Imap_PlaceHolder* to some different single width chars if they so desire... The advantage in this method is that the change will be very easy to implement. Just doing a simple % s/=AB\(.\{-}\)=BB/<+\1+>/g should suffice... In option 1, because of the \, we will have to careful about the difference between '\frac{=E4}{=AB=BB}=AB=BB' and "\\frac{=E4}{=AB=BB}=AB=BB". Also in option 2, the scripts will be lot more readable. The danger in option 2 ofcourse is that in some situation, the user has things like "<+" in the file independent of latex-suite. (But in that case, the user can use a different value for the placeholders). Hmm.... As you can imagine, I am leaning towards option 2. Are there any other suggestions? On Sun, 8 Dec 2002, Luc Hermitte wrote: > May be you could wrap these call into commands that will automatically > build the different environments and TeX commands. > That's what I've done in my lh-tex package. Thus, patching the files > will be quite easy. [1] > The way things work now in latex-suite is that things like let s:figure =3D "\\begin{figure}[=ABhtpb=BB]\<cr>\\begin{center}..." are defined. When Imap_PutTextWithMovement is called it attempts to replace =AB=BB chars with the thing defined in g:Imap_PlaceHolder*. In a wa= y therefore, latex-suite does actually wrap the commands into a central function. > call <SID>MapMenu4Env("50.370.200", '&LaTeX.&Environments.&itemize', > \ ']ei', 'itemize', '\item ') > that also defines 3 mappings and 3 menus. The insert mode mapping > ']ei' inserts: > \begin{itemize} > \item =B5 > \end{itemize}=AB=BB > Wont this also create exactly the same problems we are seeing now. For example, I am replying to this mail in vim with encoding=3Dlatin1. When I switch to utf8, the \mu character looks like <b5> etc... --=20 Srinath Avadhanula Dec 8 2:40pm Bees are very busy souls They have no time for birth controls And that is why in times like these There are so many Sons of Bees. |