Skip to content

Instantly share code, notes, and snippets.

@jwt625
Last active February 5, 2017 02:48
Show Gist options
  • Save jwt625/27f28f5bb8db5892ab08570ba71562f1 to your computer and use it in GitHub Desktop.
Save jwt625/27f28f5bb8db5892ab08570ba71562f1 to your computer and use it in GitHub Desktop.
sublime user plugins and snippets, etc
import datetime, getpass
import sublime, sublime_plugin
class AddInfoCommand(sublime_plugin.TextCommand):
def run(self, edit):
today = datetime.date.today()
self.view.run_command("insert_snippet", {"contents": "```noteinfo\n{\n\t\"date\": {\n\t\t\"y\": %s,\n\t\t\"m\": %s,\n\t\t\"d\": %s\n\t},\n\t\"tag\": [\"$1\"]\n}\n```" % (int(today.strftime("%d")),int(today.strftime("%m")),int(today.strftime("%Y"))) } )
# import datetime, getpass
# import sublime, sublime_plugin
# class AddInfoCommand(sublime_plugin.TextCommand):
# def run(self, edit):
# print("called")
# self.view.run_command("insert_snippet", { "contents": "%s" % datetime.date.today().strftime("%d %B %Y (%A)") } )
# class AddTimeCommand(sublime_plugin.TextCommand):
# def run(self, edit):
# self.view.run_command("insert_snippet", { "contents": "%s" % datetime.datetime.now().strftime("%H:%M") } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment