Created
October 13, 2018 16:27
-
-
Save swarn/ca37b9eb42eed0314f5276634147eb05 to your computer and use it in GitHub Desktop.
Revisions
-
swarn created this gist
Oct 13, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ 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 []