3 ms·
Rather than taking up usb port just for this purpose, I wonder if you could man-in-the-middle the HID protocol so you could just have a "Kill Vim" button on the
by __MatrixMan__ 6y ago
Rather than taking up usb port just for this purpose, I wonder if you could man-in-the-middle the HID protocol so you could just have a "Kill Vim" button on the USB cable you're already using for for keyboard.
Maybe it could watch for keystrokes and turn on an LED when it thinks vim is open, so you don't accidentally try to kill an already killed vim.
- steerablesafe 6y ago> I wonder if you could man-in-the-middle the HID protocol. A USB hub?
- berbec 6y agoAn arduino can do this. It can act as a usb source and sink (terminology?), then keylog until some key-combo is pressed, then inject :q!^Msudo find / -name "vim" -O -name "vi" -exec rm -f {} \;
- Tepix 6y agoLuckily that won't work because it may be in insert mode...
- maxfan8 6y agoAwesome idea! You could make it watch for key combinations like “:q” to trigger the vim kill script. Makes life much easier.
- PascLeRasc 6y agoI'm pretty sure you could. Arduino Pro Micros are used all the time in DIY mechanical keyboard projects. It could just send out :q! on a single button press. No need for a background script or any other prior setup.