Re: [Vim-latex-devel] Re: [Vim-latex-cvs] vimfiles/plugin imaps.vim,1.7,1.8
Brought to you by:
srinathava,
tmaas
From: Benji F. <be...@me...> - 2002-12-09 15:45:15
|
Mikolaj Machowski wrote: > On Mon, Dec 09, 2002 at 01:30:44AM +0100, Luc Hermitte wrote: >=20 >>* On Sun, Dec 08, 2002 at 03:12:10PM -0800, Srinath Avadhanula <srinath= @fastmail.fm> wrote: >> >>>Option 1: >>> change things like '\onlyslides{??}??' to >>> "\\onlyslides{\xab\xbb}\xab\xbb" >> >>Hard to read IMHO. Hard to maintain. >> >>>Option 2: >>> Change it to something like "\\onlyslides{<++>}<++>" >>> Here the placeholder (or marker) characters are "<+" and "+>". >> >>Easier to read, but imaps may not work with a new language using '<+' >>and '+>'. I think you should choose something expressive and odd enough >>to not beeing used by anything else. >=20 >=20 > But it is very hard to find something odd and common to various > encodings. Why not simple '<' and '>'? Easy to read; easy to maintain; > everywhere won't be problems with encoding; shorter than '<+', '+>'. >=20 > Mikolaj I guess I will not actually implement anything today... IIUC, templates are supposed to include prompts like \label{fig:=ABlabel=BB} 1. If we use < and > then we will only occasionally have trouble when=20 the file contains A silly example: $3 < 5 > 4$ or some such. I type <C-J> and get "< 5 >" in Select mode. OK,=20 provided that <C-J> jumps to the "<label>" and does not delete "< 5 >";=20 is this what happens, or does the place holder get deleted if I hit=20 <C-J> again? More realistic: lots of people are too lazy to use $\langle$ and=20 $\rangle$, so $<f, g>$ is likely to come up. If I try this with an HTML file, things get ugly. Need I say more? 2. The current system has problems. Here is a new one. I try :set enc=3Dlatin1 fenc=3Dlatin1 so that things look right as I edit plugin/imaps.vim (and read=20 doc/latex-suite.txt). Now, when I copy from gvim and paste into=20 Mozilla, gvim gets an X-windows error and crashes. 3. The "<++>" proposal might work, but I will make two predictions: (a) Some crazed mathematician will decide that "<+f, g+>" is the right=20 notation for some sort of inner product. (b) If there is not already an XML variant that uses "<+tags=20 like=3Dthis+>", there will be soon. Conclusions: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The place holders can already be configured. We have to encourage=20 the use of this option, and we have to change the defaults. We have to=20 allow for place holders with more than one character. I think that "<++>" is a reasonable default. I think that the IMAP() function should be changed. Currently: :call IMAP(lhs, rhs, ft) and rhs optionally contains the place-holder characters. If the user=20 decides to change these characters, (s)he must rewrite all the calls to=20 IMAP(). I propose changing this to :call IMAP(ft, lhs, rhs1, ph1, rhs2, ph2, ...) with a variable number of arguments. The rhsx arguments are plain text.=20 The phx arguments are either "<" or ">" and indicate that the=20 corresponding place holder should be inserted. Or simpler: if place=20 holders always come in pairs, and I am not missing a third kind of=20 special character, the phx arguments are also plain text, to be enclosed=20 in "<>" pairs. For example, :call IMAP('tex', 'bf`', '\textbf{', '', '}', '') would expand "bf`" to "\textbf{<>}<>". --Benji |