Patrick
Patrick

Reputation: 1939

VIM latex-suite inserts macro code instead of executing macros

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.

Upvotes: 1

Views: 572

Answers (2)

Patrick
Patrick

Reputation: 1939

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.

Upvotes: 0

Luc Hermitte
Luc Hermitte

Reputation: 32966

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.

Upvotes: 0

Related Questions