iTranslated by AI
Controlling Vim with a Left-Hand Device
This article is the 391st post for Vim Ekiden.
There are devices known as "left-hand devices" (macro pads) that provide additional keys, wheels, and knobs that can be used separately from your main keyboard. These devices are useful in situations where a keyboard would be too bulky or when you need extra keys, and they can, of course, be used when working with Vim.
Admittedly, since using them requires moving your hand significantly away from the home position during typing, the compatibility between left-hand devices and Vim isn't necessarily ideal, but the setup itself is perfectly possible. This article describes the procedure for setting them up.
Setup Procedure
First, assign hotkeys to the keys on your left-hand device.
Not all left-hand devices are like this, but many do not send unique keycodes on their own.
Therefore, you need to configure them so that pressing a key sends a specific key input, such as Ctrl+F1 or Ctrl+Shift+F2.
Regarding the hotkeys, since we want to define the actual operations within Vim, it is recommended to use keys like Ctrl+F1 or Ctrl+Shift+F2 that do not conflict with existing shortcuts in your OS, terminal emulator, terminal multiplexer, or Vim itself. For example, if you have a 3-key device like the Wooting UwU, you would set the hotkeys for the keys as follows:
| Left-hand device key | Hotkey |
|---|---|
| Key 1 | Ctrl+Shift+F1 |
| Key 2 | Ctrl+Shift+F2 |
| Key 3 | Ctrl+Shift+F3 |
Next, configure the operations corresponding to these keys in your vimrc.
For example, with the following settings, the operation for each key on the left-hand device would be:
" Save (write) with Key 1 (Ctrl+Shift+F1)
nnoremap <silent><C-S-F1> <Cmd>write<CR>
" Open a new tab with Key 2 (Ctrl+Shift+F2)
nnoremap <silent><C-S-F2> <Cmd>tabnew<CR>
" Toggle between Normal mode and Insert mode with Key 3 (Ctrl+Shift+F3)
nnoremap <silent><C-S-F3> i
inoremap <silent><C-S-F3> <ESC>
| Left-hand device key | Operation |
|---|---|
| Key 1 | Save (write) |
| Key 2 | Open a new tab |
| Key 3 | Enter Insert mode if in Normal mode; return to Normal mode if in Insert mode |
That's all for the setup procedure.
You can assign any operation you like to the keys.
However, because using a left-hand device requires moving your hand significantly away from the home position, it is not very suitable for operations you use constantly. It is recommended to assign operations that are used occasionally but don't feel right on any specific keyboard key. I suggest first considering mapping operations to your keyboard keys, and then moving to a left-hand device as a secondary option.
In my own case, outside of Vim, I assign audio device switching to the keys on my Stream Deck. It's an operation I use occasionally, and since most keyboard keys are already assigned to various apps—meaning any key I chose would either conflict or require multiple modifier keys—I assign it to the Stream Deck side. [1]
Configuration Examples
Let's look at some configuration examples for several left-hand devices.
The Vim-side configuration remains the same as described in the setup procedure; here, I will show how to configure the settings on each device.
ACK05 Wireless Shortcut Remote
In the case of the ACK05 Wireless Shortcut Remote,
after connecting it to your PC following the steps in the manual at the URL below,
download and install the configuration software from the subsequent URL.
There are multiple installers available, but you just need to choose the latest version for your matching OS.
Once you have installed the "Pentablet" configuration software, launch it.
When it starts, a window like the following will appear.

First, let's create a profile to prevent keys from being input outside of the terminal.
Open the profile addition dialog from the "+" icon at the top right of the window. Select your terminal application from the list if it's there, or browse for it if not, to create the profile.
Then, in the default profile, right-click each key to bring up the key settings dialog and set them to "Disable" under "Other".
If a new profile is created and the keys are disabled in the default profile as shown below, you won't have to worry about accidental inputs. [2]


Next, in the profile you just created,
right-click the following keys to open the key settings dialog and set the hotkeys under "Express Key" -> "Keyboard Input" as follows.
Once the hotkeys are set for the keys like this, the configuration on the ACK05 Wireless Shortcut Remote side is complete.
| Left-hand device key | Hotkey |
|---|---|
| K1 | Ctrl+Shift+F1 |
| K2 | Ctrl+Shift+F2 |
| K3 | Ctrl+Shift+F3 |

In addition to the keys, the ACK05 Wireless Shortcut Remote allows you to assign operations to the wheel. If you have operations you'd like to assign to the wheel, it's a good idea to configure those as well.
Microsoft Number Pad
While more of a numeric keypad than a dedicated left-hand macro pad, in the case of the Microsoft Number Pad, follow the manual at the URL below to connect it to your PC, then download and install the configuration software installer from the following URL. There are multiple installers available; simply choose the one that matches your Windows architecture. [3]
Once the Microsoft Mouse and Keyboard Center is installed, launch it. When it starts, a window like the one below will appear.

For the following keys, left-click the key to open key settings, select "Show all commands" -> "Key combination", and set the hotkeys as follows. If the hotkeys are configured for the keys as shown, the setup on the Microsoft Number Pad side is complete.
| Keypad key | Hotkey |
|---|---|
| / | Ctrl+Shift+F1 |
| * | Ctrl+Shift+F2 |
| - | Ctrl+Shift+F3 |

Since the Microsoft Mouse and Keyboard Center does not have a profile feature, if these hotkeys conflict with other keys, I recommend using different hotkeys.
Stream Deck Pedal
While it's more of a foot pedal than a traditional left-hand macro pad, in the case of the Stream Deck Pedal, follow the steps in the Quick Start Guide at the bottom of the page at the URL below to connect it to your PC, then select your OS from the "Filter by System" dropdown at the top right of the page and download and install the configuration software installer from the Stream Deck download section.[4]
Once the Stream Deck software is installed, launch it. When it starts, a window like the following will appear.

First, let's create a profile so that keys aren't triggered outside of the terminal. Open the Preferences window from the gear icon, go to the Profiles tab, select Stream Deck Pedal, and create a profile by clicking "+" -> "Add New Profile". Once the profile is created, select your terminal application for the "Application" setting from the list if available, or via "Other" if not. Then, in the default profile, check the box for "Make this my default profile". If a new profile is created and the default profile is set as the default as shown below, you won't have to worry about accidental inputs.[5]


Next, in the profile you just created, drag and drop "System" -> "Hotkey" onto the following pedals and configure the hotkeys as follows. Once the hotkeys are set for the pedals like this, the configuration on the Stream Deck Pedal side is complete.
| Foot pedal pedal | Hotkey |
|---|---|
| Left | Ctrl+Shift+F1 |
| Center | Ctrl+Shift+F2 |
| Right | Ctrl+Shift+F3 |

Since it's a foot pedal, it won't break your home position posture, but I think it takes some getting used to because we don't usually use our feet for operations. It kind of feels like suddenly having a third or fourth arm—it's hard to figure out how to use it effectively... personally, I got confused, so I currently haven't assigned anything to it.
Summary
In this way, you can assign Vim operations to left-hand devices. Vim is something you operate by letting your hands memorize the movements, so it can be difficult to make good use of left-hand devices, but there might be situations where they prove useful. If you're interested, give it a try.
-
Whether a Stream Deck counts as a "left-hand device" is a bit debatable... ↩︎
-
This is not a required setting, so you can skip it if you wish. ↩︎
-
As far as I could confirm, the configuration software is only available for Windows; I could not find versions for Mac or Linux. ↩︎
-
As far as I could confirm, the configuration software is only available for Windows and Mac; I could not find a version for Linux. ↩︎
-
This is not a mandatory setting, so you can skip it if you wish. ↩︎
Discussion