[Vim-latex-devel] Re: imaps, version of 3rd jan 2003
Brought to you by:
srinathava,
tmaas
From: Luc H. <her...@fr...> - 2003-01-08 01:21:46
|
* On Tue, Jan 07, 2003 at 12:02:57PM -0800, Srinath Avadhanula <sr...@fa...> wrote: > > - The jumpBack does not work correclty. Try for instance: > > :vmap <C-k> <Plug>IMAP_JumpBack > > i<+foo+> <+bar+> <+three+> > > <esc>gg > > ^J^J^K > > This was a bug. I have fixed it. Actually, fixing this bug made me > realize that I was making some other stuff needlessly complex. Things > are nice and simple after this bug fix. Thanks! See the latest version > in the cvs tree... 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] > > - the mappings are not silent. > Oh? I have done something like: > > imap <silent> <Plug>IMAP_JumpForward <c-r>=IMAP_Jumpfunc('', 0)<CR> > if !hasmapto('<Plug>IMAP_JumpForward', 'i') > imap <C-J> <Plug>IMAP_JumpForward > endif > > Doesn't this make the maps silent? Do I need The guilty code is: ':call histdel("/", -1)|let @/=histget("/", -1)' I think it is due to the fact it is returned as a string passed to '<c-r>='. Set 'cmdheight' to 2 or more to see the echoing. At first I defined an intermediary (and silent) mapping. My last version does not use v/phe/e anymore. But: " cursor is at the beginning of a marker. let select = 'v'.virtcol('.').'|o' call search('\V'.escape(phe,'\')) return select. gv_or_c Unfortunatelly, unless I mess vim-marks, I can't go to another line (than the current one) while in visual mode. > > - why do you need a specific jump function to use with IMAP() ? I > > haven't looked in the mecanics, but I find this odd ; I didn't > > need such a thing with µTemplate. > > Well, I am kind of unsure what you mean by this question... But this > was done mostly on purpose, since we did not want to duplicate code in > IMAP() and IMAP_Jumpfunc(). If you are asking about why > IMAP_Jumpfunc() now takes 2 arguments, well, ... I didn't give it much > thought. In fact, I was wondering why a :normal <Plug>IMAP_JumpForward wasn't enough ? Or may be directly a: :call IMAP_JumpFunc(0) What makes the inclusive search so different and required ? > > - I don't mess with @" anymore > So you use @_ like in IMAP_Jumpfunc()? '"_c' actually. So yes. > > There is also a new command: > > :SetMarker {open} {close} > > that sets the two strings used to define the marker -- no need to > > know the name of the two options. > > Interesting, but I dont think end users will use this. Also, variables > are nicer because nothing needs to be source'd apriori, so they can be > set in .vimrc (the most natural place). I wasn't thinking to end-user but to ftplugins writers. 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. The important advantage: it wraps the call to iconv(). Neither the end-user nor the .texrc writter have to worry about calling iconv() for funky strings. > > - and to test the echoing approach (as opposed to the > > marker-selection). > > I tried the echoing approach, but it didn't work, because the command > line is taken up with -- INSERT --, overwriting whatever is echoed. > Have you found a way around it? :set cmdheight=2 It is unusable otherwise. I have to comment/document this. > Per Benji's request, I've also commented IMAP_Jumpfunc() and taken > care of <+placeholders > withlinebreaks+> 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. -- Luc Hermitte http://hermitte.free.fr/vim/ |