Created
October 13, 2018 16:27
-
-
Save swarn/ca37b9eb42eed0314f5276634147eb05 to your computer and use it in GitHub Desktop.
Textmate-style isoD snippet for SublimeText
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
import sublime, sublime_plugin | |
from datetime import datetime | |
class TimestampCommand(sublime_plugin.EventListener): | |
"""Expand `isoD` to YYYY-MM-DD.""" | |
def on_query_completions(self, view, prefix, locations): | |
if prefix == 'isoD': | |
val = datetime.now().strftime('%Y-%m-%d') | |
else: | |
val = None | |
return [(prefix, prefix, val)] if val else [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment