I'm new to vim-latex and have been reading some tutorials. I've noticed that the behaviour of the F5 on my machine is rather different from what the tutorials tell me.

I'm supposed to expect F5 to expand an environment (if the name of the env is typed) or to select from a list in order to expand.

However, all I am getting \usepackage{name of environment} being returned, which doesn't make sense to me of course since I'm trying to add environment tags and not a package.

Why is there such a deviation from the expected behaviour?

  • Which operation system are you using? Windows, Linux/Unix, Mac, ...? I noticed that the Vim shortcuts under Windows are different as under Linux, which is where Vim comes from. – Martin Scharrer May 1 '12 at 5:20
  • i'm running on ubuntu – Reuben L. May 1 '12 at 5:21

If you press F5 when the cursor is located outside \begin{document}...\end{document}, latex-suite lets you add packages, i.e. it inserts \usepackage statements. Moving the cursor inside the document section should lead to the desired behavior.

  • argh can't believe i made such a stupid mistake haha! trying to add environments after \end{document}! thanks! – Reuben L. May 1 '12 at 5:34
  • Oh no sorry to disappoint. I was a little hasty in accepting the answer but turns out the problem is still there even when I try it within the document tags. – Reuben L. May 1 '12 at 5:45
  • 1
    turns out the issue is that the template had some erroneous tags which led vim-latex to believe that i was outside the document tags. in a way you were right so I'm still gonna give you the vote. – Reuben L. May 1 '12 at 5:48
  • I'm glad to hear my guess was kind of helpful. It's true that latex-suite can easily be tricked by (broken) TeX/LaTeX constructs it doesn't expect at a specific location. Nonetheless, it usually does a great job. – Martin May 1 '12 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.