Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Vim Foot Pedal (hackaday.com)
156 points by tomerbd on Dec 18, 2022 | hide | past | favorite | 128 comments


I resolved this pain by making the Caps Lock key work as it should: tap for “Esc” and hold for “Control”. Then I took the Escape key and made it Caps Lock—it’s occasionally useful, but not nearly enough to warrant a home row position.

You can do this with Karaniner Elements on macOS. There’s a way to do it on Windows too, but how escapes me at the moment.


On macOS you can do this using just the stock OS. It's under keyboard settings. You can also do this on iOS, it's awesome if you have a physical keyboard and like to use vim on your iPad


You can do the simple remapping. The “tap for escape, hold for control” takes additional software.


Here's a summary on how to do it on the respective OS's https://gist.github.com/tanyuan/55bca522bf50363ae4573d4bdcf0...

It's an interesting concept. I have been using capslock as control for so long that I don't know I could get used to this though.


To be clear, that link shows how to use extra software to do it in each OS including Karabiner on macOS.


I don’t know what’s cooler. This setting in MacOS / iOS or having a dedicated foot pedal to press “i” or “esc”


Tried that some years back. Or the simpler version where it is just Control. Didn’t work I found out because I was using my pinky to activate a very common modifier key. It was uncomfortable. I ended up remapping caps lock to Ctrl-C.

I just use the good old control keys now. Either by using my palm or (more commonly for the left one) the last knuckle of my pinky finger.


You can do this in QMK too if you have a custom mechanical keyboard. It'll work regardless of machine or os then.


I think a custom mechanical keyboard is going to be much nicer than a foot pedal.

Though, I'd encourage a custom keyboard where the thumb can reach 2-3 keys each (instead of only really being able to hit the spacebar). That way, you can put Esc on a thumb key. -- e.g. ZSA's moonlander or planck ez are nice.


Or switch to a sun keyboard where this was the native layout


I feel like people who think the "CTRL" key goes on the home row never pressed CTRL+Z, CTRL+X, CTRL+C or CTRL+V in their entire lives.

Makes zero sense ergonomically to put the CTRL key on the home row.

I tried it for about 0.05 seconds and after pressing CTRL+Z one time I knew it was not a good idea for me. pinky finger does not like pressing a key while being on a higher row than another finger also pressing a key. painful.


That is simple. Just keep your control key and map caps lock to control also. That way you are never out of control.


My fix for this is to also remap holding the Enter key to right control.

That way I can use the "control" key on the opposite side of the alpha key, the same way one is meant to do with the shift key when touch typing.


I'm not a programmer, mostly do CAD / CAM and general construction business whatever.

I remapped capslock to delete, and shift-capslock to capslock for the rare occasion I want to yell at my future self.


I just naturally used my ring or middle finger to press capslock in those cases. If you like the idea, then maybe stick with it longer than <1 sec. ;)


<1 sec was enough.


thats becauze ctrl z/x/c/v aren't used for copy paste if you're using vim or emacs.


Now if only other programs would agree (e.g. web browser)


there are a lot more programs in use today than vim or emacs.


Switching ESC to Caps Lock took significantly less time to retrain muscle memory than I expected.


I think AutoHotkey would be the program to use on Windows?


For a simpler solution I can recommend https://github.com/randyrants/sharpkeys. Of course AHK is great tool for all kinds of more advanced customizations.


I’d recommend Power Toys for that. AHK is cool but better for scripts and automations. Power Toys has lots of other neat functions and support by MS.


I found power toys didn't work too well, especially when you want to turn it off and on, or put exceptions for some programs

I just have a simple autohotkey script + vim like keys for going up and down in textboxes/selection/dropdowns.

  <!k::Send {Up}
  <!j::Send {Down}
  Capslock::Esc

Only downside is the mess that happens when on other machines that don't have that, also try to use ^[ as much as possible.


AutoHotKey scripts can be compiled in to portable executables.


<C-[> is a native remap to Esc btw


But it doesn’t work globally in the OS. It’s nice to casually mash capslock as esc to get out of modals and such all over the OS, even in games.


I did the same thing, but also mapped Caps Lock to Cmd+Shift+Ctrl+Option (so-called Super key) when it's pressed together with another key. Useful for application switching and other custom stuff.



For a more general solution, I prefer https://github.com/randyrants/sharpkeys on Windows.


I already had my caps-lock as backspace so I settled on using single quote as ESC. It works great except when I need to use a lot of single quotes of course.


For Windows 10 people: Microsoft PowerToys has a "remap keys" function within the Keyboard Manager. It's very convenient and easy to use.


I've tried this, it sometimes doesn't seem to intercept the key in time, so funny things happen. Others, the key gets "stuck".

I've tried modifying the Super / Win key. It would often happen that the keyboard would become unusable and behave like if it had the Win key stuck, even though it was remapped to something else.

This actually happened on Windows 11, not 10 (never tried on that). I don't know if it makes a difference.


Karabiner elements*


I did and still comfortable with the following YMMV. Alt -> Ctrl Ctrl -> Alt Caps -> Esc Esc -> Caps


Kmonad for Linux


I wonder how to do that with .Xmodmap


I swear sometimes I feel like I’m the only person in the world that thinks hitting the ESC key is easy and no big deal.

Maybe it’s decades of doing it, and I don’t consider myself especially dexterous, but I never have any problem with it.


Agreed. Most vim users swap esc with caps lock anyway, making it even easier to reach.

I don't think pedals bring any significant ergonomic benefit, but pedal setups look cool nonetheless.

Swapping keys isn't interesting and you can't write a blog post about it.


> Most vim users swap esc with caps lock anyway

"Some", sure, but "most"? Not so sure about that.

Besides, everyone knows what Ctrl is the One True Key™ in place of the Caps Lock and that only degenerate infidels map it to anything else.


> Besides, everyone knows what Ctrl is the One True Key™ in place of the Caps Lock and that only degenerate infidels map it to anything else.

Haha yeah I've heard about that and I like the joke =) But I was never interested in adopting it. Because I configure my alt keys to act as ctrl keys which imo results in a much more ergonomic setup.

Ctrl is the most pressed control key for people like me who live in the terminal. But the default placement of the ctrl keys in modern layouts is so wrong. I have never understood it. I guess there has to be a historical reason but I've yet to find out. (Help me, greybeards)

I should't have to move my hand and strain my pinky to reach out the most pressed control keys. With alt it's so much easier. I don't have to move my hands nor use my pinkies. My thumbs already rest on the spacebar and I just have to make a little thumb movement.

Swapping ctrl with caps lock is an ok remedy but alt keys are in a much better place.

So ctrl goes where alt is by default.

But do I swap ctrl with alt? No!! Alt is a frequently used key as well so the default ctrl keys aren't a good fit for alt either. Instead I set the keys immediately adjacent to the default alt keys to act as alt. It's the Super key (sometimes referred as the "Windows" key) on the left side and the context menu key on the right.

Lastly, I set the default left ctrl key to act as Super and the right ctrl key to act as context. Because I virtually never use those.

(I think Apple got this mostly right. cmd is the most used control key for the average Apple user, and opt is next. Their placements are perfect. Though it's still problematic for developers as ctrl is again at the worst place possible. Because of that, what I do in Macs is swapping ctrl with cmd while leaving opt where they are.)

If I'm an infidel for doing this so be it. But with this setup, I'm extremely efficient one. I type and code and enter & exit from repls and jump between interfaces like a damn machine, impressing mostly everybody who watch me use my computer.

Ergonomics FTW


> Ctrl is the most pressed control key for people like me who live in the terminal. But the default placement of the ctrl keys in modern layouts is so wrong. I have never understood it. I guess there has to be a historical reason but I've yet to find out. (Help me, greybeards)

I've seen this talk here and the speaker mentioned the ADM-3A (that is also mentioned in the article itself) terminals at about the 17/18 minute mark. Mind the keyboard layout :)

https://jackrusher.com/strange-loop-2022/ https://en.m.wikipedia.org/wiki/ADM-3A


Thank you, I very much appreciate this. Will happily watch the talk which looks very interesting to me. Cheers!


I actually don't really care, although trying the "regular" Ctrl on my laptop feels odd, but I'm also not used to using it.

It's just what I'm used to. I grew up on the MSX which, like many keyboards of its day, had Ctrl where we now have Caps Lock. When we upgraded (well, "upgraded") to Windows 95 I found some hack to make CapsLock behave like Ctrl because I was so used to it. Later I started using Linux and BSD and of course carried over the mapping with xmodmap. I've never really known anything else than Caps Lock being Ctrl.

Another oddity from my MSX days that took me years to get rid of was that a line would only be saved if you pressed "enter" at the end of it. That is, if you were editing some file, went up a line, edited it, and then just went down a line (without pressing enter) it wouldn't actually get saved. It took me quite a long time to get rid of the habit of "End + Enter" to make sure the line got saved (which wasn't needed on any other system I've used).


Thank you, I appreciate your answers very much, very interesting to me!


For whatever reason IBM in their wisdom decided the AT keyboard should move Ctrl from next to A to where it is now. And I guess since that's when PC clones really started to pick up steam and decided to copy the most recent keyboard it got entrenched. And when Apple decided to bring the control key back to the Mac I guess it made some sense to copy what the PCs were doing and also not mess with previous Mac user's keyboard skills?

Japanese keyboards have extra keys near space. It's possible with software to remap those keys to something else like Ctrl. Really wish more keyboards had usable thumb keys...


I always wondered why people are finding it so hard to hit control. And then realized I've been using ThinkPad for 25years which has control closer. Maybe it's not as insane choice / change as I always thought!


That makes sense but I think it's still ergonomically incomparable to having ctrl right next to my thumb. At least for me who use it so very frequently.


Why not have the best of both worlds?

Both my Ubuntu and OSX machines are setup so that just pressing Caps Lock alone = escape, and holding Caps Lock = control.

For the curious, to do this in OSX I use Karabiner + a "complex modification" (i.e. import a small JSON config). And for Ubuntu I use a few 'xcape' commands that autorun on startup.


Emacs pinky isn't really a problem if you don't use Emacs keybindings ;)


My personal heresy is: ino jj <esc>

I like it because my fingers never leave the home row.


That, and "inoremap jk <Esc>".


Better is "inoremap fd <Esc>" especially if you ever try to type Dijkstra or the alphabet.

Of course now you have to call your file descriptor something else. No free lunches.


For some unremembered reason I changed from that to set <esc>=jk. No idea why but it also works.


I tend to use escape in most circumstances, but I am increasingly partial to Ctrl-[ when using certain keyboards where the escape key is a bit too far for me. It's another option that's always available by default.


I have found Ctrl-[ to be the best option for a while. I swap Caps Lock and Ctrl since I am most used to Emacs/Readline-style keybindings, and even though I have moved over to Vim-style keybindings for all development I use Ctrl too much for other things to justify swapping Esc and Caps Lock. Ctrl-[ works 99% of the time, and the places it doesn’t work are usually mouse-driven anyway.


Ctrl-[ is so ingrained in my muscle memory that even when I finally mapped capslock to esc I still never use it.


I mean your fingers are already there and you're frequently hitting ctrl and hard brackets if you're programming. Just makes sense. <C-[> is the way to go. So many people customize vim in ways where native functionality is easier.


You're not alone, it is one of the easiest keys to hit since it lies all by its own in a corner with no danger of hitting any other keys when whacking it with whatever finger - or combination thereof - is at hand. To be honest I had to guffaw a bit at the rationalisation for using a foot pedal:

The basic concept was to use a pedal to enable switching between normal and insert modes. In Vim’s predecessor, vi, switching modes was easy, with the ESC key located neatly by the Q on the keyboard of the ADM-3A terminal. On modern keyboards, though, it’s a pain, and so a foot pedal is a desirable solution.

So let me get this straight... it is easier to blindly grope for a foot pedal somewhere under a desk than it is to hit that very visible, very close-at-hand key on the keyboard with whatever appendage happens to be closest? Of course it isn't, this is just rationalisation for making that foot pedal - as if any reason is needed to indulge in such projects other than 'because I (want to find out if I) can'.


For ages I lived with X40 and X60 form-factor ThinkPads, which have perfectly sized keyboards for my hands. The ESC key is easily accessed on these for me without leaving home row placement, palms comfortably planted.

Every ThinkPad I've had since then has been a regression in this department, beginning with the X201s and now I'm on an X230 and my typing is awful compared to the 4:3 X-series glory days. Reaching for the ESC key is noticably annoying compared to what I know so well to be the ideal. Why Lenovo kept stretching the keyboard to accommodate their widescreen transition instead of relocating better speakers to the keyboard flanks is beyond me.

But having suffered through this mess I fully understand why vi(m) users remap ESC to CAPS or pursue other mitigations. ESC key access is highly sensitive to keyboard-size:hand-size, and I suspect for many it's just inconveniently distant like my X230 is for me.


Yeah, I just slap in that general direction and it works fine. That’s the beauty of that corner location, still fairly close and very forgiving.

(And I don’t want to use Caps Lock for that, Backspace on the other corner of the keyboard is far less convenient, that’s what I want Caps Lock to be.)


I've literally never thought of using it for that. I don't think I'll switch but wish I also had the idea several years ago. Smart!


I think a lot of keyboard ergonomics comes down to the facts that some people do anything to avoid moving their hands, and others don't.

If you don't move your hand, you'll have to stretch your fingers, and might be better suited to a minimalist keyboard with function layers.


I have long fingers and like using Esc and Functions keys (custom mapped).


It’s not so much the hitting escape, but the reorienting yourself on the keyboard after you hit it. Same with the numpad on the right, I’m desperately trying to stop using it, but it’s a tough change.


It wasn’t that easy on the ill fated Touch Bar, which prompted my move to Caps.


I appreciate this reminder to re-read one of the funniest things I've ever seen on the internet: "acme vs emacs vs vim": https://imgur.com/WLzeQMj


I actually bought one a while back for the emacs metakeys issue which had 4 buttons (it was originally designed for turning pages on a pad while playing music). It worked pretty well while it lasted, but broke after like a year.

Having a qmk split keyboard (the iris specifically https://keeb.io/collections/iris-split-ergonomic-keyboard) was a more lasting solution that also solved some other ergonomic issues. Now my thumbs do more than just thonk the space bar. Control, shift, space, meta, backspace/delete, enter alt and esc are now done by thumbs instead of pinkies.


I think resourcing foot pedals from the music world (guitars and bass mostly) would be the way to go, they're designed for heavy use and would likely be much more durable.


A lot of these USB pedals are about as sturdy as piano sustain pedals.

More literally though, the Logidy UMI3[1] is a MIDI-over-USB foot controller that uses guitar pedal-like switches. It's designed to serve as a hardware interface to software loop control, but you can use a MIDI yoke or translator[2][3][4][5][6][7][8] to turn MIDI input into keystrokes, game input, etc.

1: https://www.logidy.com/umi3

2: Using just `aseqdump` to capture input, `xdotool` to simulate keystrokes, and a 7-line shell script to glue them together: https://superuser.com/questions/1170136/translating-midi-inp...

3: https://www.bome.com/products/mtclassic

4: http://www.varal.org/ttymidi/

5: https://midikey2key.de/

6: https://hautetechnique.com/midi/midishortcut/

7: https://github.com/xobs/midi-to-keypress (Rust, Linux/macOS/Windows, open source)

8: https://charlie-roberts.com/midiStroke/, https://github.com/charlieroberts/midiStroke/ (macOS, open source)


I wrote a post a while ago about getting an inexpensive three-button foot pedal to work under Linux.[1] I have the different buttons mapped to different keys in Xorg (which can then be mapped to any commands in .vimrc), but I'm not sure how to map the keydown and keyup events to different keys so that the "clutch" behavior can be implemented in software only.

1: https://catswhisker.xyz/log/2018/8/27/use_vecinfinity_usb_fo...


Until I switched to a kneeling chair I had a 3 button foot pedal under my desk. I programmed it with https://github.com/rgerganov/footswitch and it worked an absolute treat. As an i3 devotee it was even more special.

It didn't support up/down events but that was ok for me.

For me the mapping was: button 1 i3 workspace back_and_forth. button 2 exec a floating urxvt terminal. button 3 i3-lock.


Why don't people use <C-[>? It's a vim native function and even in vimtutor. You're probably using control and hard brackets already for programming (yes, I understand you Europeans have keyboards hostile to programming. I accept your remaps just fine)


FTA: “Plus, there’s some ergonomic benefits to not having to strain one’s hand over to reach the ESC key.”

Honest question: Is it that uncommon knowledge that Ctrl+[ is equivalent to ESC in vim default keybinds?


It’s equivalent in any terminal, not just in vim. ASCII “control” characters are paired up nicely with the letters and punctuation on a keyboard. Instead of having a key for each letter and another key for each control code, the control code can instead be typed by holding the control key and pressing the equivalent letter. This is why it is called the control key.

The pairings are offset by 0100 in octal. The octal ordinal for escape is 033. 0133 maps to [ so ^[ (control-open-square-bracket) is equivalent to escape.

Some other common ones are: line feed/^J, backspace/^H, tab/^I, and end-of-transmission/^D. If you ever type “exit<enter>” to end a shell session you can do the same with ^D.

Similarly of course you don’t have keys for upper and lower case letters. You use the shift key for that, which shifts the code by 040 instead of 0100. Technically it’s down by 040 because while most keys are labelled in capitals their default behaviour is to send the lower case letter.


>Some other common ones are: line feed/^J, backspace/^H, tab/^I, and end-of-transmission/^D. If you ever type “exit<enter>” to end a shell session you can do the same with ^D.

Yes. Also line feed/^J, form feed/^L, carriage return/^M.

And, related: anyone not knowing the basics of vi, can check out my vi quickstart tutorial below. I had first written it at the request of two Windows sysadmin friends of mine, in a company where I was working at the time. They had been given additional charge of two Unix boxes and I wrote the tutorial to enable them to hit the ground running with common sysadmin editing tasks. After reading it and using Unix for a few days, they told me that it was useful and met their need.

The tutorial is small, so it can be read soon and you can start applying it right away:

https://vasudevram.gumroad.com/l/vi_quick?layout=profile


Yup, this is what I've been using since I started with vi[m] (~30 years ago).

It's pure muscle memory after the first week or two, is obviously faster than fumbling around for ESC (which may move slightly between keyboards).

It works on every terminal, also on every keyboard, doesn't require customisation of your vim environment (compare to remapping CAPSLOCK) which is highly preferable if you're moving between ephemeral hosts and/or hosts you don't own or can't conveniently customise.


This person here didn't know. Thank you, need to try it out.


There is no reason to assume that people don’t know of it simply because they don’t use it.

For me: annoying to use a modifier for a common key + doesn’t work on my keyboard.


I remapped pressing jk kj kk jj to escape. As a regular vim user, only sometimes do I actually press i to insert, usually it's cw, a, s, etc.


> As a regular vim user, only sometimes do I actually press i to insert

This is important and the same thing I came to post. I'm not by any means a power user, but even for me, just having i as the way to get into insert mode pretty much defeats the purpose of not having to use the keyboard, because you still need the keyboard to get the cursor where you want it.

The concept of a pedal system is cool, it would be nice to think about how it could be made more comprehensive to handle a bigger subset of mode changes.


> Plus, there’s some ergonomic benefits to not having to strain one’s hand over to reach the ESC key.

Doubt. I simply move my hand. There is no strain.

Gross movement is not unergonomic.


Map holding caps lock to control and esc on tap, you never use it anyway :)


For me, caps lock is no better than ctrl. There's only one, meaning key combos on your left require stretching your 4th (pinky) finger out. I caused permanent damage to my 4th finger that way. Do not recommend.


Correct answer. This is one of the few defaults that makes sense to change as it can be done at the OS level, which will then be inherited to the tens of different systems i use vi on a day.


OS offer emulating Caps Lock by pressing both Shift keys, no? This would be a solution for people who HAVE TO WRITE UPPERCASE A LOT for some reason.


This takes me back... 25 years ago I visited a company called "Zeus" in Cambridge UK, who made a web server that competed with Apache httpd, and was told about their developers' Escape pedals.


When reading all these recommendations, I wonder why nobody is using ctrl-c to exit insert mode..?


Dang that's a great idea. C-c C-c for me triggers vim slime, but the semantic of using it to exit insert mode might warrant a change


It behaves differently than Esc.


I am also curious as to how. I have been using CTRL-c for quite some time and even remapped sublime vintage mode to use it on Windows when I am. It using Vim.


See my reply to the other comment.


How?


2ix<esc> inserts “xx”

2ix<c-c> inserts “x”

Also, <c-c> does not trigger InsertLeave.


I have remapped caps lock on my keyboard to Esc, so it works everywhere, not only for Vim. Very convenient, symmetric to Enter. I hardly ever need caps lock as such.


The only downside is that it's a pain to work with a regular keyboard due to muscle memory. Though that doesn't occur often in my case.


Sexy idea, but as someone who started using vi in 1987, a software solution seems way better. I map the seldom-otherwise-used key sequence jk to <ESC>. If I were doing it over, kj would be slightly better, for times when I am Just Kidding. I do this in both .vimrc and .inputrc (using different syntax, sigh). My fingers generate the escape without thought. (As is true for tons of vim normal mode actions I use regularly.)


Nah, that’s not the way. If you go that route it’ll only work in Vim itself and not other programs with a vi-like interface.

Better to map caps to ctrl and build up the muscle memory to use ctr-[

If you do that you also get easy access to all those other Insert mode ctrl shortcuts.


Both jk and kj appear in normal writing for me :(

I briefly considered a foot pedal but it seems to me that foot dexterity is far lower than finger, meaning typing ihello<esc> is FAR faster than <pedal down>hello<let go>, not to mention that pedal travel is way longer.

Of course you map esc to caps.


I did jkj instead.


It seems nobody has mentioned my hack of choice yet: map tab to escape, and shift-tab to tab. I rarely indent manually anyway, and tab cycles indentation levels in all language modes I work with, so I don't need anything mapped for shift-tab.

I do really like the idea of tapping vs. holding caps lock mentioned in another comment here, though. I could probably get used to that instead.


I've always used Ctrl + C. I thought everyone did the same. Can't even remember where I learnt it from.


I tried doing that for awhile, but I kept hitting `fn` by accident on the Macbook keyboard, since that's the button on the bottom left corner. I probably would have eventually gotten used to it, but I found it easier to just remap caps lock to escape.


Using Emacs on contemporary keyboards causes similar problems because the Ctrl key used to be in a much more convenient location. I have had good experiences switching the left side Alt and Ctrl keys to remedy the problem. But the foot pedal is almost more elegant.


I'm surprised that nobody brought up yet that pressing i is rarely the only way to enter insert mode. As a vim power user, I use a, o and c (after different types of selecting some part of existing text) at least as often. That would make the clutch useless in the presented form, so I'm skeptical that this is actually being used.

Using the clutch either as a full esc replacement would make more sense (send esc on tap down, send nothing on release). Or inverted, send nothing on tap down but send esc on release, and have the user train that they subconciously tap the foot down upon entering insert mode by any means.


My setup is quite unusual in that I VNC into Linux over Samsung DeX. After working around its annoying unchangeable keybindings, I remap the keys back as they should be on the Linux side with xmodmap. But then it seems to only change keycode and not keysym or something, so many programs don't respect that (vim included). I can't get rid of the muscle memory for Esc, no matter how much I tried to use Ctrl+[ or jj or similar, so I use xte to simulate a key press which is slooow when you're really going fast. If anyone has any ideas on how to get around this please lmk!


It's a fun idea, but I'd imagine it's far too slow to press down your foot compared to tapping your fingers.

I personally use a home-row combo as escape, by pressing down the left index and ring finger at the same time.


Someone long ago, probably here, suggested binding the sequence 'K-J' to 'ESC'. Now I don't even have to take my fingers off the home row.


If you're going to do this, I recommend mapping both jk and kj, so you can just mash the keys simultaneously.


I love the creativity in the comments to address this „problem“ if you want to call it that. A couple of years ago I made a software-only thing to trigger two alternating key sequences (e.g. Esc and i) by pressing down one of those cheap USB pedals. A little bit hacky but it works. https://github.com/baumschubser/footswitcher


I love it. Some months ago I had a Bluetooth pedal with several footswitches. It could be used as a keyboard. I thought about mapping it to a step debugger :D


I would love to use something like this to get back on emacs, but it doesn't travel well. I'm on the bus, I'm at a friend's house or my mother-in-law's house or my brother's house all the time with my computer open. I don't want to be tied down to a specific device or get out a foot pedal on the bus every time I want to program.


I recently took on pedal steel guitar. Which has both foot pedals and knee levers. Along with both hands (plucking and barring chords).

It’s really changed the way I think about input methods. Pedals have always been a thing, but primarily for effects, not part of inputting notes. Those lazy knees weren’t doing anything!!


Organists might dispute that


Just for a little bit of context lost in the HAD summary, this was not a serious build!

> ... what better way to show my appreciation to an infrequent Vim user, than to add another rarely useful peripheral to their bag!

> ... As much as I built the pedal for a joke, I can’t deny that there is something very satisfying about using it.


I’m not sure I understand the pedal, according to the wording it sounds like I have to stay pressed to remain in insert mode which sounds way worse.

Personally I have remapped caps to ESC system wide and it’s a pleasure to work with


My preferred solution is to map Caps Lock to Control, then map Control-Space to exiting insert mode in Vim. That way, I get improved convenience both in Vim and in other programs, such as the shell and web browsers.



There's is also this similar project from 11 years ago. https://github.com/alevchuk/vim-clutch


I wanna see a double-eye-blink detection for ESC key in vim. Super easy (try it!) and very natural. Probably straight forward to detect 2 rapid eye blinks using a cheap webcam + CV.



Foot pedals! My grandmother used to operate an IronRite ironing machine (you can find them on eBay) which had knee-operated levers, too.


`Ctrl-[` works like escape in vanilla Vim. I prefer it because I don't have to lift my hand from the keyboard, unlike hitting escape


I honestly can't believe people complain about having to hit the ESC button. Is this for real?


Yeah, this works for the accelerator, I want brake pedal to send Ctrl+[:wq though


This is completely useless. Who even uses `i` to enter insert mode?

I am almost always using one of the following instead:

- o: open new line below current line

- O: open new line above current line

- I: insert at beginning of current line

- A: append to end of current line

- cc: change current line

- C: change to end of line

- ci(: change in current parenthesis

- ci": change in double quotes

- ctX: change to character X

- cfX: change to found character X

Each of these will perform an action and leave you in insert mode after the action. Then using `.` you can repeat both the changing action and the insert, all in one keystroke. Obviously impossible to do if you only use `i` and `a`.

Vim is not about toggling modes. Vim is an entire language to express text transformation, that you can then repeat with `.`, or undo with "micro commits" to your file, traversing the history back and forward in sensible chunks instead of the usual chaos of Ctrl-Z in other editors. (You can even branch your undo history!)


> Who even uses `i` to enter insert mode?

Most novice vim users.


I'd make two pedals.

Crtl and alt. Caps as escape..




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: