Skip to content

Instantly share code, notes, and snippets.

@christianwish
Created September 28, 2018 10:42
Show Gist options
  • Save christianwish/bc3d2ce00bf4846bc57eca3b3a3f3568 to your computer and use it in GitHub Desktop.
Save christianwish/bc3d2ce00bf4846bc57eca3b3a3f3568 to your computer and use it in GitHub Desktop.
sublime text 3 clock plugin
import sublime
import sublime_plugin
from datetime import datetime
class ExampleCommand(sublime_plugin.EventListener):
# def printInConsole(self, text):
# print(text)
def updateClock(self, view):
timeArr = str(datetime.now().time()).split(':', 3)
showTime = timeArr[0] + ":" + timeArr[1]
view.set_status("myClock", " ⏱ " + showTime + " ")
#view.show_popup_menu(["test 1", "test 2"], self.printInConsole)
def on_modified(self, view):
self.updateClock(view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment