I just found out that you can add snippets within the autocomplete (Awesome, btw). Unfortunately, in the autocomplete window, it displays the $0, $1, etc. Please hide this.
[SOLVED]Autocomplete hide Snippet components
quarnster
#2
You do that yourself in the tuple returned by on_query_completions. The first item in the tuple is what is displayed to the user, the second item is what is actually inserted. So for example from the code I wrote here
import sublime_plugin
import datetime
class DateCompleter(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
return
("YYYY-MM-DD", str(datetime.date.today())),
("YYYY", str(datetime.date.today().year)),
("MM", "%2d" % datetime.date.today().month),
("DD", "%2d" % datetime.date.today().day)
]
0 Likes