BMW Shifter Becomes Vim Keyboard
To make Vim slightly less frustrating to use, Aaron Patterson converted a BMW shifter into a dedicated Vim controller called "Initial V."
If you're still driving a 1995 Ford Taurus, then you can be forgiven for being unaware of recent innovations in automotive technology. Instead of the simple mechanical shifters you're used to, many cars made over the last couple of decades use drive-by-wire electric shifters with unusual control schemes. Aaron Patterson took one of those shifters from BMW and converted it into a keyboard for Vim.
This particular shifter works like a normal automatic transmission shifter, in that the driver physically moves it from drive, to neutral, to reverse, and so on. But it has two interesting features: a park button and a "manual" mode for changing to a higher or lower gear. That enables "gestures" accomplished by moving the shifter in different patterns. For example, pushing the shifter up is a distinct action that can trigger an event. This project, dubbed "Initial V," turns those gesture events into specific key presses for Vim.
Vim, for the uninitiated, is an open source text editor that is very popular for Unix and Linux users who want to flex their geek cred. Vim is meant to run within a terminal and doesn't support mice, which means the user has to utilize a confusing set of keyboard commands to work within the software. If you're not already deep into the Vim culture, you probably don't want to start. But you can see why Patterson wanted a way to streamline his use of Vim.
As you would expect for something that came from a modern car, this shifter communicates via a CAN (common area network) bus. To intercept those communication messages and detect the gestures, Patterson designed a custom PCB that contains an ESP-MINI-1 development board and an SN65HVD230D CAN transceiver. The ESP-MINI-1 has a Bluetooth adapter, which is how it sends key presses to the connected computer. That PCB and the shifter mount to a custom 3D-printed enclosure.
Patterson's software translates gestures in different ways, depending on the position of the shifter. If the shifter is in drive, then it is in normal mode. If the shifter is in neutral, then it is in insert mode. Each mode has its own set of commands, which depend on how the shifter can move in that position and what actions are necessary.
The result is an interface that looks really nice, allows for quick and intuitive operation, and that makes Vim a bit less frustrating to use.