Re: [Vim-latex-devel] imaps, version of 3rd jan 2003
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2003-01-07 20:03:05
|
Hello, On Tue, 7 Jan 2003, Luc Hermitte wrote: > Hello, > > - we don't have to test 'wrapscan', |search()| does it implicitly for us Thanks for the tip. I removed the extra code. > - 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... > - the mappings are not silent. Oh? I have done something like: imap <silent> <Plug>IMAP_JumpForward <c-r>=3DIMAP_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 imap <silent> <C-J> <Plug>IMAP_JumpForward also? > - 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 =B5Template. 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. I guess the arguments could be optional and default to ('', 0)... Again, I dont see any advantages/disadvantages either way. > Otherwise, I've integrated in bracketing.base.vim some of the things you > use [thanks!]: > - the 'nomagic' stuff ; BTW, the psh and phe strings need to have their > '\' escaped -- I haven't checked if it is needed for other characters. Forgot to do this in the latest commit. Will fix this next time. > - I don't mess with @" anymore So you use @_ like in IMAP_Jumpfunc()? > - I've managed the visual selection in another way that does not mess > with the search-history at all-- way that expext the > marker/placeholder to hold on a single line. Well, the latest imaps.vim is able to handle <+placeholders withlinebreaks+> (or without linebreaks) without messing up @/. This is simply done by appending ':call histdel("/", -1)|let @/=3Dhistget("/", -1)' to normal commands. Works quite well so far... > 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). > - 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? Per Benji's request, I've also commented IMAP_Jumpfunc() and taken care of <+placeholders withlinebreaks+> Thanks, Srinath |