-
-
Save tmacam/728cddd9825ad8ce8ad048837433a741 to your computer and use it in GitHub Desktop.
Revisions
-
tpitale revised this gist
Aug 18, 2014 . 1 changed file with 1 addition and 1 deletion.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 @@ -3,5 +3,5 @@ class TimestampCommand(sublime_plugin.TextCommand): def run(self, edit): timestamp = "\n[%s]\t" % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M")) self.view.insert(edit, self.view.sel()[0].begin(), timestamp) -
tpitale revised this gist
Aug 18, 2014 . 1 changed file with 1 addition and 1 deletion.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 @@ -4,4 +4,4 @@ class TimestampCommand(sublime_plugin.TextCommand): def run(self, edit): timestamp = "[%s]\t" % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M")) self.view.insert(edit, self.view.sel()[0].begin(), timestamp) -
tpitale created this gist
Aug 18, 2014 .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,5 @@ 1. Go to Tools > New Plugin 2. Paste timestamp.py contents and save in User as timestamp.py 3. Open Preferences > Key Bindings - User (or Default, your call) 4. Paste keybindings.json, or add a line to your keybindings 5. Customize the keyboard shortcut to your liking and save 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,3 @@ [ { "keys": ["ctrl+shift+n"], "command": "timestamp" } ] 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,7 @@ import datetime import sublime, sublime_plugin class TimestampCommand(sublime_plugin.TextCommand): def run(self, edit): timestamp = "[%s]\t" % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M")) self.view.insert(edit, 0, timestamp)