Yes, you did. Thanks for both replies.
Here is my solution, which might be helpful:
- I have a number of snippets for different cite types. They are all triggered with cite and look like this:
<snippet>
<content><![CDATA[
\citep{${1}}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cite</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.tex</scope>
<!-- Optional: Description to show in the menu -->
<description>(author year)</description>
</snippet>
- The syntax specific settings:
{
"auto_complete_triggers": {"selector": "text.tex", "characters": "\\"},{"selector": "text.tex", "characters": "ci"} ],
"auto_complete_commit_on_tab": true,
"spell_check": true
}
- And finally (very important) a user specific keybinding:
{ "keys": "tab"],
"context":
{"key": "selector", "operator": "equal", "operand": "text.tex"},
{ "key": "preceding_text", "operator": "regex_contains", "operand": "cite(\\w]*)?\\{", "match_all": true }
],
"command": "latex_ref_cite"}
This keybinding triggers the selection of a reference when the user presses tab but only if the preceding text is something like ‘citep{’. So as a result I can just type ‘c’, which triggers the popup with the different cite auto-completions. Now I select one such as (author year) using ‘tab’, which completes c to ‘\citep{}’. I press tab again and the popup for the bibtex key comes up. This works super well for me.
ps: I am also triggering the auto-completion after \ but I am still working on getting a popup with a comprehensive list of latex commands.