Trying to get a particular SuperTab behavior with snippets and omnicomplete

I'm trying to get SuperTab to work a particular way with .tex files. I am also using the vimtex plugin as well as snipMate.

The behavior I want is the following.

1. In most text, I want the main priority to be completing snipMate snippets. If none are found, then I want a real tab.

2. However if I have started to write a \ref, \cite, \eqref, \include or \includegraphics (did I miss any?) command, I want omnicomplete first. If omnicomplete can't find anything then I want nothing to happen (i.e. no real tab).

3. In general, I never want tab to initiate a <C-n> or <C-p> keyword completion ever for any reason!

I have been through the SuperTab documentation several times and I just don't get it. I can't see how the plugin works well enough to determine what settings I need.

Right now I am using the default settings. The behavior I am seeing is that snipMate snippets are being completed first (that's what I want) except they are always taking precedence even after a \ref{ for example. If no snippet is found I am always getting keyword completion.

EDIT:

I decided to overhaul my whole setup to address this. It took some effort, but seems to work the way I want it now and is probably better in the long run. The new approach is to use YouCompleteMe for completion, UltiSnips for snippets, and SuperTab to hack the previous two via this clever configuration: https://stackoverflow.com/a/22253548/509489

So the problem is now resolved (although not solved)

• I'm curious, can you not (at least partly) solve this by letting SuperTab use omnicomplete as the first complete function, then complete snippets as the second alternative? I've not used SuperTab in so long I don't remember the correct options... – Karl Yngve Lervåg Feb 1 '16 at 7:28
• I'm not sure. From the Supertab documentation I can't tell how one would indicate complete snippets as an alternative. Supertab does seem to have some built-in support for snipmate, however. The default behavior gives the snippets priority in all situations. So to implement your suggestion I would need to know both how to tell Supertab to explicitly try to complete a snippet as well as how to tell it to not try to complete snippets by default. I'm not sure how to do either of these things! – evencoil Feb 2 '16 at 2:34