Is there a way to automatically trigger the autocomplete popup while filling out a snippet field? I want to be able to select from a list of predefined defaults. It seems easy enough to modify DictionaryAutocomplete plugin to make custom lists, but I don’t see how to do the triggering on tabbing to a new field (for some reason ctrl+space is also not working for me, version 3079)
Trigger autocomplete popup from snippet field
FichteFoll
#2
Check out the auto_complete_with_fields
setting.
If you mean to automatically open the panel when switching to the next field then you can either override the default binding(s) for the next_field command and instead run a macro, or use an on_post_text_command
hook.
I don’t know if the auto_complete
command is macro-able though.
0 Likes
gawells
#3
Thanks! I hadn’t thought to look at macros, this seems do do the trick:
user key-bindings:
{ "keys": "tab"], "command": "run_macro_file", "args": {"file": "res://Packages/User/snippet_complete.sublime-macro"}, "context":
{ "key": "has_next_field", "operator": "equal", "operand": true }
]
},
snippet_complete.sublime-macro:
{"command": "next_field", "args": {}},
{"command": "auto_complete", "args": {}}
]
0 Likes