Skip to content

Vim pedal is a USB HID device for more comfortable text editing for Vim users.

Notifications You must be signed in to change notification settings

foxweb/vim-pedal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Vim pedal by Aleksey Kurepin

Introduction

Vim pedal is a USB HID device for more comfortable text editing for Vim users. When the pedal is pressed down, the pedal sends i [1] causing Vim to go into "Insert Mode". When released, it types Esc and you are back in "Normal Mode".

Hardware

PCsensor USB footswitch

It is equivalent to a standard HID USB keyboard and mouse, but it is customizable by using the setting software (we don't use it), which can define your foot switch as any keys, key combinations or mouse. No other software is required.

PCsensor also has a triple and mechanical versions of the footswitch.

PCsensor USB footswitch

DF Robot Beetle / Jtron Beetle / Arduino Leonardo or clones

DF Robot Beetle or Jtron Beetle is a clone of Arduino Leonardo on microboard.

The Arduino Leonardo is a microcontroller board based on the ATmega32u4. The Leonardo differs from all preceding boards in that the ATmega32u4 has built-in USB communication, eliminating the need for a secondary processor. This allows the Leonardo to appear to a connected computer as a mouse and keyboard, in addition to a virtual (CDC) serial / COM port.

Jtron Beetle

Why isn't USB footswitch enough?

USB footswitch is a standard USB HID device, equivalent to a generic PC-keyboard with one key. One pedal — one key. It's not enough for implementation of switch of Normal/Insert Vim mode.

I decided to use Arduino-compatible microcontoller with custom firmware for replacing PCsensor's pedal controller. Actually I decide to use PCsensor's optical sensor that switches when pedal pressed/released.

In this way I combined Beetle with optical sensor to reach my goals.

My solution differs from the project of Aleksandr Levchuk, because he used two PCsensor pedals and two USB ports!

Also my solution has additional features. Users can change the device's workflow logic on fly, add new input methods and use unlimited and flexible capabilities of Arduino microcontrollers. So, you can use Vim pedal as a PC mouse!

And finally Vim pedal has a killer feature — Arduino's blinking LED! [2]

Software

  • Vim pedal is compatible with any OS and any platform, which supports generic USB-keyboard and Vim.
  • Firmware Vim pedal is possible on OS X, Linux and Windows where Arduino IDE works.
  • Source code. Open Arduino IDE, compile and firmware this source.
  • You can use extra features of Mouse and Keyboard libraries for Arduino with Vim pedal.

Construction

  1. First prototype. Optical sensor from PCsensor board connected to Beetle board. Prototype

  2. Assembled inside pedal case with micro-USB connector. Prototype Prototype

  3. Insulated with electrical tape. Prototype

  4. Done! Prototype

Demonstration

Demo vim-pedal

Known problems

  1. Vim pedal does not work correctly in non-latin layouts in Vim window.
  2. According to russian DIY traditions electrical tape should be blue. Only blue electrical tape (also known as izolenta) guarantees 100% reliability!

Credits

Inspired by Aleksandr Levchuk's vim-clutch.

Resources

Notes

[1] When Vim in "Insert mode" and pedal is pressed down, you can get an undesirable symbols i in your text. To avoid this I decided to send Esc + i when pedal pressed down for exiting from "Insert mode" if this mode has already been enabled.

[2] Beetle has a LED onboard, but not using in my application.

License

Creative Commons License
The Vim pedal work by Aleksey Kurepin is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

About

Vim pedal is a USB HID device for more comfortable text editing for Vim users.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%