[Vim-latex-devel] Re: imaps, version of 3rd jan 2003
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2003-01-08 13:03:54
|
* On Tue, Jan 07, 2003 at 06:42:42PM -0800, Srinath Avadhanula <sr...@fa...> wrote: > > I will check it. Does it works even when the cursor is within a > > placeholder boundaries ? [my last conclusions was that I need to > > call searchpair twice] > It does work... If you are in the middle of a placeholder and press > <C-j> it will goto the next placeholder. <C-K> selects the placeholder > you are current in... I like your idea of using "'<" with visual mappings. And regarding the fact the backward-search jumps to the current PH instead of the previous one is not completly illogical. I will eventually simplify my code to adopt your way. > > [not silent mapping] > > Set 'cmdheight' to 2 or more to see the echoing. > Hmm... I dont see anything on the commandline even with cmdheight = 2. > Dunno... Maybe I'll randomly add a <silent> next time... That's odd. Things have changed since the 3rd january version and the 1.24. Now, it is all right. > > What makes the inclusive search so different and required ? > Well, here's the comment in the latest imaps.vim > [...] I see. Thanks. > > I will eventually have to make many experiments in order to be able to: > > - let ftplugins change the values of opening and closing string > > - let ftplugins encoded in latin1, utf-8, etc > > - be compatible with any encoding of fileencoding for the current > > buffer/file. > Benji has spent time on this and I think we have a working system right > now to do all of this. We have even thought of things like "what if the > placeholder setting was done in a file with 'fenc' different from the > tex file which the user is editing?" So if you want, you might want to > see whats done here. I've seen his function just after I've written an equivalent one. Now, I'd curious to have some input from people using encodings other that latin1 or utf-8. > [multi-line PH] > > I'm skeptical about their usefulness (English ?). When we need long > > tags/comments, I'd rather use a templates plugin like the one > > written by Robert "Feral" Kelly. > Well, even if we have some other ways of generating templates, I would > be very reluctant to have another function do the actual jumping between > placeholders. Code duplication! > > Does this templates plugin offer something different? FTE (the plugin) serves a different purpose ; it has nothing to do with jumping. I see multi-line PH as an helper to the end-user who has just inserted a template (from a file or from IMAP(), or ...). If the text is really long and explain many things, I'm not sure PHs are the best things to use. I see them more as markers where we will jump to and we will eventually replace by some other text. FTE permit to insert lines like (don't remember the exact format): FTE: -------------------- begin ------------------- FTE: some introduction to the template that has been inserted FTE: this comment may be very, very long. FTE: FTE: Next: the name of the environment FTE:a: %%%(environment name ; this is a PH) FTE:b[ ]: Do you wish to center it ? FTE: \begin{@a} FTE: IF(@b, \begin{center}) <+insert your code here+> FTE: IF(@b, \end{center}) \end{@a} <++> FTE: some last comments FTE: -------------------- end ------------------- Then, we can assign some value to @a and @b (by replacing the %%%() placeholders), interpret the corresponding code (with <F6> for instance). The result displayed could be: \begin{itemize} .... cursor here .... \end{itemize} <++> I see his plugin as a multipasses templates plugin. One interresting use is to insert the signature of some functions and an excerpt of their man. A solution made of PHs only would have contain a several lines-long PH introducing the template. IMHO, this is a mis-use of PHs. > Also, latex-suite does support templates in custommacros.vim ... and in templates.vim But so far, I'm not sure it is as evolved as FTE or my unofficial version of µTemplate. -- Luc Hermitte http://hermitte.free.fr/vim/ |