Skip to content

Instantly share code, notes, and snippets.

@btipling
Last active August 29, 2015 14:08
Show Gist options
  • Save btipling/0d6faa80b24ccee5caea to your computer and use it in GitHub Desktop.
Save btipling/0d6faa80b24ccee5caea to your computer and use it in GitHub Desktop.
# Put this in ~/.nvim/pythonx/
# requires python, see :he nvim-python
from threading import Thread
from time import sleep, strftime
class EventLoop(Thread):
def __init__(self, vim):
super(EventLoop, self).__init__()
self.vim = vim
def run(self):
while True:
sleep(0.1)
self.vim.session.post('tick')
class NvimClock(object):
def __init__(self, vim):
self.vim = vim
self.eventLoop = EventLoop(vim)
self.eventLoop.start()
def on_tick(self):
self.vim.command('set statusline=%s' % (strftime("%H:%M:%S"),))
@thinker3
Copy link

how to run this file? I found two snake.py, one of them can run as it said in the doc.
but this file seems not working even put in ~/.nvim/pythonx/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment