Building A Clutch For Vim

Whether you’re using emacs, vi, or vim, your fingers will be performing acrobatics on your keyboard because of the mouseless interface. [alevchuk] thought his feet could be used as a way to reduce the amount of keystrokes, so he built the vim clutch. It’s a USB-enabled foot pedal that will insert characters before the cursor in vim.

Vim requires the user to type the letter ‘i’ to insert text before the cursor. [alevchuk] thought this function could be easily replicated by a foot pedal, so he found an extremely cheap USB foot pedal to serve as his vim clutch. Ideally, the pedal should send ‘i’ when it is pressed and Esc when it’s released. [alevchuk] took two pedals, programmed one to send ‘i’ and the other to send Esc, and put them in the same enclosure.

The result is a working clutch for inserting before the cursor in vim. [alevchuk] is looking into a three-pedal model to add inserting at the beginning and end of the line to his vim clutch, so we’ll keep an eye out for when he posts that build.

43 thoughts on “Building A Clutch For Vim

    1. I’ll likewise restrain myself from advocating God’s own editor, but I will note that I’ve never heard of anyone needing to build custom hardware just to make it work the way they want it to. (Granted, hacking Lisp is an intimidating requirement for a newbie — but I’d still prefer that to having to bust out a soldering iron to configure my software.)

      1. I don’t think you understand what is happening here. The software is not being configured. Going from insert mode to command mode is what seperates it from a standard text editor.

      2. Or we can use an editor which requires you to be able to play the piano.

        Vim is all about moving your fingers as little as possible, and having a tiny executable.

        Emacs, as far as I can tell, is an OS replacement that requires you to use every meta key at once.

      3. John – Emacs doesn’t require the use of every meta key simultaneously, at least unless you want it to; the most complex single-chord combination out of the box is Control-Alt plus a letter key. If that’s too much for you, I don’t know what help I can offer…

      4. I still don’t think you understand… And what do you mean by ‘afford’? People who use vi were poor? You can use meta keys if you want – I have CTRL x c and v enabled for pasting into and out of vim.

  1. I thought it would make more sense for the pedal to work the other way around. Have the editor default to insert mode, and press the pedal to enter a command. Having to keep your foot in one place for long coding sessions seems awkward.

      1. That was a good one. How did he miss that before pressing the submit comment button?

        And I see that the Church of Richard Stallman of Latter Day Saints still sends missionaries into the field and that they are still vile.

  2. I’ve gotta say, as a regular vim user, I just don’t quite get this from a usability standpoint. The opposite behavior (insert mode on release, as Rachie proposes) makes a *little* more sense, but… the different commands to enter insert mode at different locations (A/a/S/s/R/I/i/O/o… did I get all of them?) are one of the subtleties of vim that gives it so much power. Done editing the middle of the current line and want to key typing on a new line below? ESC->o. Such movements become second nature after a while, and if you’re just going to be constantly using i-insert… you may as well not use a modal editor. This would be like someone adding a a pedal to hold down CTL for emacs; the speed of a keystroke is just gonna be so much faster and more comfortable than anything your foot can do.

    One idea to make it more comfortable that a lot of people do is use CAPS as an ESC key — most OS’s have the ability to disable CAPS functionality, and rebind it to ESC. It can be similarly useful as CTL, if your preference is emacs (slightly less pinky travel for a highly-used key in both cases).

    1. Caps mapped to Esc is neat, except that Caps mapped to Ctrl is useful in places other than my text editor.

      I tried writing my own editor, too. Turns out you can do that with Emacs, except you don’t have to build the whole damn thing from scratch first. Very useful.

  3. Actually using the pedal to enter the colon would not be that useful because a colon is on your home…..wait I see what you did there. Clever.

    For the record, no other editor comes close to vi.

      1. It is so much quicker and easier to use (obviously there is a learning curve) than any other editor. It is also easily extensible, and you can make simple customizations to it.

  4. Cool idea, but I agree with Matt above, it’s not really useful. I would have to say that I don’t use i anymore than I use any of the other commands (I find myself using c and o more often, even).

    The foot pedal idea is still awesome, and I’m going to have to think up something cool to use one for…

  5. I just knew when i saw it that it would start a emacs/vim war in the comments…
    I think its quite clever, because it solves the thing that annoys me the most when using vim: I forget to leave i mode, or I forget to get in it.
    Haven’t found the perfect editor yet… (well, I probably could configure either vim or emacs to work like I want, but I don’t have *that* much free time)

  6. As old as the vi(m)/emacs flame wars are, I still get a kick out them for some reason..:D

    vi(m)= A powerful, extensible text editor.

    emacs= A powerful, extensible OS with a decent text editor.

  7. Guys! CTRL-[ is a universal escape key that works in any incarnation of VIM/GVIM. That’s control-left-square-bracket.

    I never understood why vim forces you to remove your left hand from the home keys to get out of insert mode, and I almost gave up on vim before I found out about it. But I discovered CTRL-[ and always wondered why they don’t make it any more widely known!

  8. Two devices, two cables and two USB ports for a single switch?
    With the right software both the down and the up could be separately configured.
    You’d only need the unmodified pedal.

Leave a Reply to BobDabberCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.