Written by Sean Behan on Sun Jun 17th 2012

You'll have to create a new plugin. From the menu bar select

Tools > New Plugin

Copy the Python script from the signature.py file. Remember to replace your email address (it's example.com). Save the file, signature.py, is fine. Next open up Preferences > Key Bindings - Default and add a new entry.

ctl+alt+s will add the snippet to the first line of your file.

# In Preferences > Key Bindings - Default 
# Add a new entry
{"keys": ["ctrl+alt+s"], "command": "signature" },

Tools > New Plugin

# Save as signature.py
import datetime, getpass
import sublime, sublime_plugin
class SignatureCommand(sublime_plugin.TextCommand):
        def run(self, edit):
                signature = "[%s %s <%s@example.com>]\n\n\t" % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M"), getpass.getuser(), getpass.getuser().lower())

                self.view.insert(edit, 0, signature)

Tagged with..
#date time sublime snippet #signature #snippets #sublime text 2 #text editors #environment

Just finishing up brewing up some fresh ground comments...