Live data from Hacker News

Vim Foot Pedal

hackaday.com

101–110 of 134 posts

Re: Vim Foot Pedal

#101

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.

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!

Re: Vim Foot Pedal

#102

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

Re: Vim Foot Pedal

#103
post #9
post #2

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

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 is FAR faster than hello , not to mention that pedal travel is way longer. Of course you map esc to caps.

I did jkj instead.

Re: Vim Foot Pedal

#104

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?

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.

Re: Vim Foot Pedal

#105
post #7

Earlier quoted context omitted.

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.

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.

Re: Vim Foot Pedal

#106
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.

Re: Vim Foot Pedal

#107
post #22

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.

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

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.

Re: Vim Foot Pedal

#108
post #22

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.

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

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

Re: Vim Foot Pedal

#109

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.

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

Re: Vim Foot Pedal

#110

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

Post reply on HN