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
# Snake for Neovim! Adapted from https://gist.github.com/sanchitgangwar/2158084 | |
# To install, create a ~/.vim/rplugin/python/snake.py file with this | |
# code, then run `nvim -c 'UpdateRemotePlugins' -c 'q'` from a shell. | |
# | |
# Make sure you have read the internal help explaining how to setup python | |
# host for external plugins(:help nvim-python) | |
# | |
# To start a new game, use the `:SnakeStart` command on an empty buffer(uses 80 | |
# columns and 20 rows) | |
from threading import Thread, Lock |
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
# 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 |
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 ctypes | |
import ctypes.wintypes | |
import win32con | |
class GlobalHotKeys(object): | |
""" | |
Register a key using the register() method, or using the @register decorator | |
Use listen() to start the message pump |