1

So I've been using latex-suite for a few years, and I realised recently that vimtex has some nice features (especially the text objects). So I'm tempted to use that instead, but it would require me to build an entire snippets library. And before I jump headfirst into this I was wondering about these two questions:

I have two questions:

  1. I was wondering if anyone has already converted the latex-suite mappings into a snippets library?
  2. While toying with migration, I discovered that the way snippets and latex-suite's IMAP() work seem different (both in the way they are coded and the way they behave), but I'm not sure whether this is a surface-level difference or whether they are so qualitatively different that I can't get the same functionality from both. Does anyone have clarity on this?

1 Answer 1

3

I was wondering if anyone has already converted the latex-suite mappings into a snippets library?

I don't know.

While toying with migration, I discovered that the way snippets and latex-suite's IMAP() work seem different (both in the way they are coded and the way they behave), but I'm not sure whether this is a surface-level difference or whether they are so qualitatively different that I can't get the same functionality from both. Does anyone have clarity on this?

LaTeX-Suite's IMAP functionality is a bad implementation of the snippet functionality. VimTeX includes a minimal snippet engine for the most basic use case such as quickly typing greek letters or math symbols (see :help vimtex-imaps).

However: You REALLY should consider to use something like UltiSnips (or any of the modern alternatives; a quick search will find you several alternatives in seconds). The engine in these dedicated snippet plugins is much better and more versatile, and they are general purpose and will work for any filetype - not only LaTeX.

Further, there are snippet collections such as honza/vim-snippets that include a lot of snippets for LaTeX.

Personally, I don't like using premade snippets - I make my own for the few things I want.

4
  • Thanks for the answer (and for vimtex plugin)! Can I also ask how snippets are more powerful than IMAP()? I've just started playing around with luasnip, so currently they look similar to me. I'm trying to decide between just creating a small version of latex suite with just the IMAPs and converting all my favourite functionality to snippets. Sep 25, 2023 at 11:11
  • Oh I see there are already some basic imap functionality in vimtex, and the default includes some of my favourite ones. This will be useful for making a basic working instance while I build up a snippet list. I would still appreciate an answer to the question above, about what make snippets more powerful, though, if you have time. Sep 25, 2023 at 11:31
  • Okay I found evesdropper.dev/files/luasnip/choice-dynamic which has clarified this question as well for me lol. Thanks! Sep 25, 2023 at 15:13
  • 1
    Glad to see you found answers. :) Sep 26, 2023 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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