Created
June 16, 2017 08:26
-
-
Save jwt625/59ba13c5ece6aee1f6352b7af3b37755 to your computer and use it in GitHub Desktop.
insert date and time in sublime
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, time | |
class InsertDatetimeCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
sel = self.view.sel() | |
for s in sel: | |
# self.view.replace(edit, s, time.ctime()) | |
self.view.replace(edit, s, time.strftime('D%Y%m%dT%H%M')) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment