News for hackers. Stuff that matters.
Re:Vim Foot Pedal by teeray on Sunday December 18, 2022 @02:22PM (#34041728)
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.

Re:Vim Foot Pedal by xigoi on Sunday December 18, 2022 @02:39PM (#34041979)
I think AutoHotkey would be the program to use on Windows?
Re:Vim Foot Pedal by pletnes on Sunday December 18, 2022 @03:21PM (#34042690)
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.
Re:Vim Foot Pedal by keithnz on Sunday December 18, 2022 @06:53PM (#34045964)
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.
Re:Vim Foot Pedal by TheSpiceIsLife on Monday December 19, 2022 @01:14AM (#34049067)
AutoHotKey scripts can be compiled in to portable executables.
Re:Vim Foot Pedal by layer8 on Sunday December 18, 2022 @06:56PM (#34046002)
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.
Re:Vim Foot Pedal by agrippanux on Sunday December 18, 2022 @02:33PM (#34041890)
Switching ESC to Caps Lock took significantly less time to retrain muscle memory than I expected.
Re:Vim Foot Pedal by woleium on Sunday December 18, 2022 @02:25PM (#34041768)
Karabiner elements*
Re:Vim Foot Pedal by Sirened on Sunday December 18, 2022 @03:21PM (#34042685)
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
Re:Vim Foot Pedal by jack_the_dev on Sunday December 18, 2022 @04:08PM (#34043406)
I don’t know what’s cooler. This setting in MacOS / iOS or having a dedicated foot pedal to press “i” or “esc”
Re:Vim Foot Pedal by teeray on Sunday December 18, 2022 @08:17PM (#34046924)
You can do the simple remapping. The “tap for escape, hold for control” takes additional software.
Re:Vim Foot Pedal by rjzzleep on Monday December 19, 2022 @02:05AM (#34049345)
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.

Re:Vim Foot Pedal by hombre_fatal on Monday December 19, 2022 @09:57AM (#34052788)
To be clear, that link shows how to use extra software to do it in each OS including Karabiner on macOS.
Re:Vim Foot Pedal by johannes_ne on Sunday December 18, 2022 @03:48PM (#34043138)
Kmonad for Linux
Re:Vim Foot Pedal by seri4l on Sunday December 18, 2022 @05:06PM (#34044091)
Re:Vim Foot Pedal by layer8 on Sunday December 18, 2022 @06:54PM (#34045968)
For a more general solution, I prefer https://github.com/randyrants/sharpkeys on Windows.
Re:Vim Foot Pedal by cramjabsyn on Sunday December 18, 2022 @05:25PM (#34044382)
Or switch to a sun keyboard where this was the native layout
Re:Vim Foot Pedal by keybored on Sunday December 18, 2022 @05:30PM (#34044493)
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.

Re:Vim Foot Pedal by shiomiru on Sunday December 18, 2022 @07:32PM (#34046442)
I went one step further - for me, "caps lock" is control, and "tab" is escape. Who needs tab anyway, it's just a glorified C-i. (Some qmk magic helps when dealing with programs where I can't rebind cua keys.)
Re:Vim Foot Pedal by ropable on Sunday December 18, 2022 @07:42PM (#34046557)
For Windows 10 people: Microsoft PowerToys has a "remap keys" function within the Keyboard Manager. It's very convenient and easy to use.
Re:Vim Foot Pedal by vladvasiliu on Sunday December 18, 2022 @11:24PM (#34048466)
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.

Re:Vim Foot Pedal by godelski on Sunday December 18, 2022 @09:34PM (#34047623)
<C-[> is a native remap to Esc btw
Re:Vim Foot Pedal by hombre_fatal on Monday December 19, 2022 @09:56AM (#34052772)
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.
Re:Vim Foot Pedal by MivLives on Sunday December 18, 2022 @09:55PM (#34047799)
You can do this in QMK too if you have a custom mechanical keyboard. It'll work regardless of machine or os then.
Re:Vim Foot Pedal by rgoulter on Monday December 19, 2022 @04:40AM (#34050220)
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.

Re:Vim Foot Pedal by lolive on Sunday December 18, 2022 @11:04PM (#34048329)
I wonder how to do that with .Xmodmap
Re:Vim Foot Pedal by naikrovek on Sunday December 18, 2022 @11:13PM (#34048397)
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.

Re:Vim Foot Pedal by TheSpiceIsLife on Monday December 19, 2022 @12:17AM (#34048775)
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 by physPop on Monday December 19, 2022 @12:20AM (#34048791)
thats becauze ctrl z/x/c/v aren't used for copy paste if you're using vim or emacs.
Re:Vim Foot Pedal by tonto on Monday December 19, 2022 @12:58AM (#34048985)
Now if only other programs would agree (e.g. web browser)
Re:Vim Foot Pedal by naikrovek on Monday December 19, 2022 @07:02PM (#34059661)
there are a lot more programs in use today than vim or emacs.
Re:Vim Foot Pedal by myrandomcomment on Monday December 19, 2022 @12:41AM (#34048908)
That is simple. Just keep your control key and map caps lock to control also. That way you are never out of control.
Re:Vim Foot Pedal by zeorin on Monday December 19, 2022 @02:30AM (#34049468)
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.

Re:Vim Foot Pedal by hombre_fatal on Monday December 19, 2022 @10:01AM (#34052832)
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. ;)
Re:Vim Foot Pedal by naikrovek on Monday December 19, 2022 @07:01PM (#34059648)
<1 sec was enough.
Re:Vim Foot Pedal by lurker137 on Monday December 19, 2022 @01:50AM (#34049272)
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.
Re:Vim Foot Pedal by roveo on Monday December 19, 2022 @08:02AM (#34051535)
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.
Re:Vim Foot Pedal by alaaalawi on Monday December 19, 2022 @10:21AM (#34053077)
I did and still comfortable with the following YMMV. Alt -> Ctrl Ctrl -> Alt Caps -> Esc Esc -> Caps