Last active
February 5, 2017 02:48
-
-
Save jwt625/27f28f5bb8db5892ab08570ba71562f1 to your computer and use it in GitHub Desktop.
sublime user plugins and snippets, etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
add note information for notes written in Markdown | |
Example: | |
```noteinfo | |
{ | |
"date": { | |
"y": 5, | |
"m": 2, | |
"d": 2017 | |
}, | |
"tag": ["papers", "research"] | |
} | |
``` | |
''' | |
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") } ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["dot", "-Tsvg", "-O", "$file"], | |
// "cmd": ["dot", "-Tpng", "-O", "$file"], | |
// "cmd": ["dot", "-Tpdf", "-O", "$file"], | |
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", | |
"selector": "source.python" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment