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. J – Yeah, I understand what’s happening here. It’s just that I use an editor which was designed by people who could afford meta keys.

      3. 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.

      4. 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…

      5. but with emacs you have to perform chains of meta key chords to do things. someone should make a piano interface to operate emacs.

      6. 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 was going to suggest using eclipse instead, but the extra exercise required is intriguing. Now all you need to do is mount the pedals like a bicycle and use the rotation for scrolling the cursor.

  2. 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.

  3. 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. now see I’m just attacking the problem by writing my own editor. When its done right, people will stop doing it.

    2. 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.

  4. 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.

  5. 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…

  6. how about wising up and de-geeking and switch to useable editor? notepad++, programmer’s notepad etc
    —rolles eyes…—

    1. Notepad++? Molest us not with this Scintilla-based nonsense. — oh, and Programmer’s Notepad has a built-in hex editor? Hardcore!

  7. Mangle irons had a knee activated switch. How about a set of three knee activated switches, left => i, right => a, up esc, chord left-up => I, chord right-up => A.

  8. 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)

  9. 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.

  10. Whyyyyyyy! So stupid solution… I have one… in linux i just remap, as any keycombo i want. You only need one pedal, unmodified…..

  11. “because of the mouseless interface”

    FTFY: “if you’re using the mouseless interface”

    My trackpad works fine with vim.

  12. 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!

  13. 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s