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-09 02:54:50
|
On Mon, 9 Dec 2002, Luc Hermitte wrote: > > 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. Well, imaps is almost unaffected by whether we choose '<+' and '+>' for placeholders or not. That will behave according to the value of g:(or b:)Imap_PlaceHolder* characters. Therefore we could conceivably have ftplugin/c.vim containing lines like: let b:Imap_PlaceHolderStart =3D '?' let b:Imap_PlaceHolderEnd =3D '?' call IMAP('for', "for (??; ??; ??) {\n??\n}??", 'c') So using something which is not very expressive is not that important. We just need to make sure that there is no ambiguity within one language itself. For example, I do not think that any of the latex maps will become ambiguous with the placeholders I've mentioned... The problem you mention is when some new language has legitimate characters such as '<+' and Imap_PutTextWithMovement() tries to replace those with the placeholder characters. That problem can be solved by using a new function Tex_PutTextWithMovement() instead of Imap_PutTextWithMovement() which first replaces things like =AB (or '<+' or '!mark!') with the user's choice and then calls Imap_PutTextWithMovement(). This makes > It is not really problematic ! I will use '!mark!' for instance > (instead of '=A1mark!' currently used) to express the markers (aka > placeholders) > Well, on further thinking, it does make sense to use longer things like '!mark!' or something similar and then replace with the user's placeholder choice in Imap_PutTextWithMovement()... But this will mean again that the scripts themselves become really long and unreadable... Well, there seems to be fair arguments for and against the using of things like !mark!. But I would think that a solution where imaps is completeley independent of the choice of placeholder characters is best. And I think each language choosing its own placeholders is most elegant and robust... Srinath |