Created
June 30, 2011 08:11
-
-
Save zrxq/1055851 to your computer and use it in GitHub Desktop.
Sublime Text 2 plugin for inserting UUID 1 (host- and time-based)
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 | |
from uuid import uuid1 | |
class generate_uuid1Command(sublime_plugin.TextCommand): | |
def insert_text(self, edit, what): | |
[self.view.replace(edit, reg, what) for reg in self.view.sel()] | |
def run(self, edit): | |
self.insert_text(edit, str(uuid1())) | |
# Bind to a shortcut by adding the following line to your | |
# user .sublime-keymap: | |
# | |
# { "keys": ["super+g", "super+1"], "command": "generate_uuid1" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment