Re: [Vim-latex-devel] Completion of Tcommands
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2003-07-14 06:36:41
|
Hi Luc, > From the outside, it looks like it is (technically) the same thing. > Thus my question: why not develop only a single generic function that > can used to insert general-templates, ``macros'' (or even packages ?) ? > May be I am wrong and you don't have to maintain three times the same > things -- which differs only by final names and directories. > > My idea is that TTemplate, TMacros, ... would invoke the same function > but with different built-in parameters. > As of now, the templates, custom macros and IMAP() functions in latex-suite are all handled by a central IMAP_PutTextWithMovement() function with differing arguments and wrapper functions (for example, TTemplate provides a prompt for the template files etc). So we do not really repeat any work. The jump function and marker functionality is all in plugin/imaps.vim. Also, one sufficiently important implementation issue in the IMAP() function is that you do not have to bind all expansions to non-keyword characters like <C-r><space> or <C-r><tab> etc. Most expansions in latex-suite are for example triggered just as :imaps work except for being able to correct, no timeout etc. Basically, only the last character of the first argument of an IMAP() is actually :map'ped to a LookupCharacter() function. A reverse lookup over previously typed characters is made whenever such a character is encountered and if there is a possible completion, it is used... This enables you to have 2-key mappings like `8 -> \infty which would have been pretty annoying to use if we had to type 8<C-r><tab> each time... BTW, very recently I started to have to compile some files multiple times and therefore quickly felt the need for a function like TKMakeDVI in tex-tools.vim (part of your latex ftplugin package). I looked at it and have been extracting parts of it to use in latex-suite. I wish to borrow the basic logic of the multiple compilations, but I wish to implement various things like TKFilesDiffer() differently to make it cross-platform without a lot of platform detection logic... I have a very rough (and incomplete) draft of this on a non-MAIN branch in the vim-latex cvs tree. Another implementation issue is that I have a parallel python implementation of the same thing and the script should automatically detect python and use the python function instead so all the things like filediff's etc can be handled via python much more cleanly than in viml. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/vimfiles/ftplugin/tex/Attic/latexm.vim?rev=1.1.2.3&only_with_tag=latex-multi-compile&content-type=text/vnd.viewcvs-markup (one big URL) Thanks, Srinath |