tags:

views:

44

answers:

2

Hi all,

I have a problem that's been bugging me for quite a while and that I can't find the solution to.

I want to use the feature where I can press <C-j> and the cursor moves to the next placeholder. This works for regular files, but when I edit .tex files (i.e. latex-suite is enabled), this inserts:

\right=IMAP_Jumpfunc('', 0)

instead of actually jumping (which I presume is done by the above mapping somehow).

There's no problem with regular mappings (that I've made myself like so: map rhs lhs), but it doesn't work for any latex-suite macros. Other example: if I insert figure (via menu), it just inserts the following inside the text:

\right=Tex_DoEnvironment(``figure'')

Sorry I can't solve this problem myself, which is probably trivial for an experienced user. But I have no-one around to ask.

A: 

Looks like you forgot the <c-r>= before the call to the function.

EDIT: I think I understand. Whem IMAPS is installed, it quickly parasites all our mappings. You will have to use IMAP() to define you own mappings. I had to do it in my bracketing-system in order to be robust to IMAP/LaTeX-suite presence.

Luc Hermitte
Yes, maybe so. There's certainly some entries in imaps.vim which contains `<c-r>=` Still, I didn't edit anything. If I understand correctly, latex-suite is supposed to call the IMAP_JumpForward macro but I don't know where it defines this mapping.
Patrick
Allright, makes sense. Thank you.
Patrick
A: 

Gah, I found the error!

I had defined a key mapping like so:

:imap <C-r> \right

(for adding to brackets in latex). This was then called by the pre-defined mappings ...

What a quagmire

Lesson taken: always comment-out entire or parts of the settings files, and then see if things start working.

Patrick
Don't forget the : "never use :map, always prefer :noremap -- unless "recursive" mappings are required"
Luc Hermitte
Right, I thought about that. But wouldn't the `:noremap` have to be put in the IMAP file, on the pre-defined mappings. Coz I tried putting it on my imap for `<C-r>` and that still messed up the mappings. I don't want to mess with the defaults...
Patrick