Skip to content

Instantly share code, notes, and snippets.

@hamsterbacke23
Created March 16, 2012 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamsterbacke23/2050871 to your computer and use it in GitHub Desktop.
Save hamsterbacke23/2050871 to your computer and use it in GitHub Desktop.
import sublime, sublime_plugin
import datetime
class SimplyInsertDateCommand(sublime_plugin.TextCommand):
def run(self, edit):
dateAsStr = datetime.datetime.today().strftime("%d.%m.%Y")
sels = self.view.sel()
cursor1 = sels[0]
self.view.insert(edit, cursor1.begin(), dateAsStr)
@hamsterbacke23
Copy link
Author

{ "keys": ["ctrl+alt+d"], "command": "simply_insert_date" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment