170 comments

[ 6.0 ms ] story [ 199 ms ] thread
Does this go well a standing desk?
When using a standing desk, I prefer to use a glute squeezer device to switch modes. It feels much more natural, and improves the muscle tone as a bonus.
How do you attach the device?
(comment deleted)
Amen. It took me weeks of practice before I could produce distinct "control", "alt", and "shift" squeezes, but now I've taken my coding to an entirely new level.
I feel like Emacs needs a footpedal more than vim... but this is cool too.
No joke, a piano style set of three footpedals with Meta, Ctrl, and Hyper, is something I would actually use.

Tricky though, because it would have to talk to the keyboard, not the computer.

Very easy to build with new customisable mech keyboard PCBs. Not tricky.

Problem is utility of tool is low. It's foot dexterity vs finger dexterity, not foot vs hand dexterity and foot dexterity is low and hard to improve. I was unable to derive sufficient utility over six months of continuous use. Would advise against.

Unlike guitar pedal, vim pedal expected to be frequently engaged.

Since the parent post was from an Emacs user: I have to disagree.

As an Emacs user, I've loved having a foot-pedal. The foot-pedal is superfluous in Vi because Vi is already modal; the foot-pedal is great in Emacs because it adds modality, kinda. Copying a post I made on Reddit a while ago:

> I found that my brain didn't want to treat the pedals like it did keys--it wanted to treat them modally. I wasn't pressing control, I was entering control-mode. I wasn't pressing shift, I was entering caps-mode. Which works out, because it isn't the quick keystrokes that cause the most strain, it's holding the modifier with one finger while the rest of the hand moves around. I wouldn't use the footpedal Control for the usual quick C-f/b/n/p, but it's great for holding Control as you C-s through a document.

https://old.reddit.com/r/emacs/comments/7remed/has_anybody_u...

3 pedals? I think emacs needs a full pipe-organ console.
I've plugged an accordion into emacs. Gives 120 buttons on left hand, 64 on right, plus chording and velocity sensitivity (hit a key harder to get upper case).

But you could easily use a midi pedalboard instead, or even in addition.

Accordion in use: https://twitter.com/ykarikos/status/1038145486618861573

> Tricky though, because it would have to talk to the keyboard, not the computer.

No it wouldn't. It works to press the modifier on one keyboard and the other keys on another keyboard.

Source: I have a set of 3 footpedals that I have as Ctrl, Shift, and Meta.

I can’t count how many times I’ve wanted a pedal when working in VR. Usually when I’m working in Unity and want to put my head and two tracked controllers into a specific pose and then trigger a breakpoint.

In the before times I would ask someone to walk over to my desk and click the mouse when I tell them. A pedal would have been much better!

That’s an interesting use case. As an alternative I wonder if you could set up a microphone to trigger the breakpoint when a word is spoken.
Nice idea but ridiculously wimpy switch. Rig up one of these American made beauties instead.

https://www.amazon.com/SSC-Controls-G500-MO-Electrical-Indus...

  from experience:  they're way more satisfying to press and oil/water/dust tight.
EDIT: fixed link. this pedal is also OSHA approved with a safety cap to prevent objects from falling onto the switch and triggering insert mode.
Link still doesn't work. I think this is what you were trying to link to:

https://www.ebay.com/itm/TEMCo-Heavy-Duty-Cast-Aluminum-Foot...

I'm not sure how you'd connect this as an ancillary USB keyboard. Seems like you'd need an Ardunio or something?

I'd love to have a few of these to control DAW apps where I don't need the hassle, cost and complexity of Midi

A handwired QMK keyboard would work fine: https://docs.qmk.fm/#/hand_wire

If you have only one or two switches, you can use the DIRECT_PINS configuration to directly put one switch per input pin rather than the more conventional switch matrix approach. You can use the XD002 code as a starting point (https://github.com/qmk/qmk_firmware/tree/master/keyboards/xd..., https://github.com/qmk/qmk_firmware/blob/master/keyboards/xd...). It uses a DigiSpark rather than the more common Arduino Pro Micro. The DigiSpark is a bit fiddly and has very little program memory, but it is very cheap and simple.

Used to use one. Lots of ankle fatigue and slow thought to action time. Never trained myself sufficiently or fast enough. Tried both clutch and toggle mode. Perhaps switch was too light. Had to worry about accidentally triggering by resting foot.

Plus side was easy to get working everywhere, including inside Ideavim.

I tried this a few years back and gave up after a few days. Moving your foot is way slower than hitting a key.
I tried it as well with foot pedals and it just wasn't working.

Maybe if I was a drummer it'd come more naturally.

Makes sense, besides, I 'a'ppend more often than I 'i'nsert, and usually jk out of insertion mode.

Hard to imagine improving the ergonomics of that.

Not for vim, but in windows I use Autohotkey to translate midi messages into macros. Get yourself a cheap midi keyboard with a bunch of buttons and knobs like the akai mpk mini or the arturia minilab 2 and you have a ton of controls to customize for any macro you want. I personally use the minilab.

Take some desk space but way way way more controls. Also, if you get interested in modular synths you can download VCV Rack for free and learn about modular synthesis with a small controller for basically free.

Or you could just get a razor tartarus or whatever they're calling them now and do similar without the midi part but with razors proprietary hardware and software.

Don't get stuck in traffic coding, you'll cramp up.
A full gearbox would be nice:

* reverse --> undo

* first gear --> replace mode

* second gear --> visual mode

* third gear --> command mode

* fourth gear --> insert mode

* fifth gear --> customizable mode

It'd occupy your hands which kinda would defeat the purpose, unless you have a gearbox that's easy to control with your foot?
Can we then write off the motorcycle sim racing rig as office equipment?
This should not be that hard to wire up since USB steering wheels with separate pedals and shifters already exist.
Everyone else is missing the point. Obviously you get an automatic transmission, otherwise you'd have to keep talking your hand off the keyboard.
Or just map escape to the caps lock key or get used to ctrl-[ and be done with it.
It seems like there are nine different ways to enter INSERT mode and they are all useful enough to be used with some frequency.

So, having the pedal simply substitute for ESCAPE would be sufficient and should be able to improve flow after some practice.

This is cool and all, but nearly useless for any experienced vimmer.

I almost never press `i` to enter insert mode, and I don't expect most vimmers to do so either. My most common ways to enter insert mode are, off the top of my head...

o -- Open new line below current line, enter insert mode.

O -- Open new line above current line, enter insert mode.

ci( -- Delete all text between the nearest parenthesis and enter insert mode within the parens.

A -- Jump to end of line and enter insert mode.

I -- Jump to start of line and enter insert mode.

C -- Delete to end of line, enter insert mode.

cc -- Delete entire current line and enter insert mode.

ctX -- Delete to the character X where X is whatever character I see ahead of my cursor that I want to delete up to, and leave me in insert mode.

cfX -- Same as ctX except include the found character in the deletion, then enter insert mode.

Seems like you just need more pedals.
(comment deleted)
Hey, maybe we could put these pedals somewhere more accessible. Like under your fingers.
Well, what makes thumb keys so great is that the thumbs are particularly independent of what your other fingers are doing. Foot switches fill the same purpose.

You can only have so many keys under your other fingers, and the more you add, the more movement will be required of your hand.

Vim should support mouse, like Midnight Commander
:set mouse=a

And away you go. As you get more efficient at vim use you might find you want to turn that off again.

(and also without the colon in your vimrc file if you want it to stick)

In general yes, but there are still some cases where mouse is better than the equivalent keys. Mainly resizing splits (guess how many lines you want and then C-w <size>|, vs just dragging the divider).

:set ttymouse=sgr also makes it a lot smoother.

You can do it with one pedal -- just tap out your preferred option in Morse.
Organ pedals would work for that. I think typically those just use magnets and reed switches (when connected electronically rather than mechanically).

Not to be confused with reed organs, which usually just have one big pedal that operates the bellows. Though sometimes they also have levers you can push to the side with your knee.

Imagine that with emacs: it's easy! Simply double-clutch the "Ctrl" and "Super" pedals while pressing Alt+Shift+T on the keyboard to open a new block context and auto-indent to the correct tab stop. ;)
"Granny shifting when you should've been double clutching..."
I still don't understand why you would double clutch a Honda Civic. Especially if you were trying to like, go real fast.
If you double clutch near redline on your RPMs, you can get marginally faster gear changes with less wear on your synchronizers.
Double clutching is changing into neutral, then into the target gear, right? How could that be faster?
Try it (shifting at high RPMs, specifically near redline) in a Honda Civic (or any other decent, but not higher end car) and you’ll see. Shift at normal RPM ranges and you’d be right to feel doubtful it would be faster.
Upshifting, it isn't usually necessary, though I'm not a street racer, so I can't comment on the validity of that particular quote [0].

Downshifting, particularly into first as you're coming to a stop sign, it'll save a fair amount of wear on the synchros. Or if you have a car with worn synchros, it'll help ensure a quicker, smoother downshift in general. A 5-3 downshift on an offramp usually benefits, for instance.

[0] Given the substantial liberties they took in general, your skepticism might be justified.

With Emacs it's click one pedal to open parentheses; click another close.
I’m thinking of pedals that a pipe organ has.
seems like it would be awfully slow for any experienced vimmer also. Seems like a really bad idea for a foot pedal / vim integration.

A, possibly, much better idea would be if you press the pedal, is turn the hjkl keys into sending actual arrow key keycodes so those annoying times when you need to arrow through OS menus etc you can use your vim instincts. Not that I'd ever want to incorporate a foot pedal myself, but seems like a better use. Vims keyboard drive approach is super quick as is, if you are having trouble with getting into and out of insert mode, maybe Vim isn't for you.

> if you are having trouble with getting into and out of insert mode, maybe Vim isn't for you.

I've got a question there actually. The only thing that throws off my flow while using Vim is exiting insert mode, as my keyboard has an inconvenient esc key. Is there a better way to exit? I've done some cursory looking but haven't found anything that looks useful.

(Remapping my keyboard isn't a viable option, as I game on my machine sometimes, and occasionally need weirdly specific keys.)

Ctrl-C and Ctrl-[ also work by default, but personally I use CapsLock after doing `setxkbmap -option caps:escape`.

> Remapping my keyboard isn't a viable option, as I game on my machine sometimes

You can also map something specifically on vim with :imap/:vmap/:cmap.

Please note that Ctrl-C does not do the same thing as Esc or Ctrl-[. More info: https://unix.stackexchange.com/questions/53633/does-using-ct...
> Quit insert mode, go back to Normal mode. Do not check for abbreviations. Does not trigger the InsertLeave autocommand event.

Well, it's the same if neither you nor a plugin uses abbreviations nor InsertLeave.

Also, if you don't need that particular behavior of <C-c>, you can do `:map <C-c> <Esc>` to make it behave exactly the same.

The best remap in my vimrc:

" Map jk to ESC in insert mode

inoremap jk <esc>

Once you've finished what you wanted to insert just hit jk. The combination never occurs in the English language and is right on the home row :)

That's fun. Does it type the j, then delete it when you press k?
Yes it does. I do the same thing but with jj.
It doesn’t type it into a buffer, iirc. I removed that from my config because it annoyed me that when I press j alone it only appears in a buffer after a delay.
yes, until you find yourself typing jk into word docs or other evil office software every time you finish a thoughtjk.
I remap capslock as escape, using autohotkey, and I game a lot, the dyson sphere program was the first game that actually had a problem, so you can either turn the script off while playing, or make the script smarter to not be active during the game. Having said that, it is worth getting used to Ctrl-[ which is the same thing, and is a standard binding which is useful when you are not on your own machine.
I use an autohotkey script to do that, on holding down space. Instant vim everywhere!
Minor improvement, cc can be replaced by S
Is shift-S faster than cc? The keys are farther away from each other, but I guess you can get some bonus by pressing them "in parallel"... For me, cc feels faster. Although I might feel differently if it was, say pp vs shift-S.
> Is shift-S faster than cc? The keys are farther away from each other

In my case, my left pinky rests on the shift and my left ring-finger rests on the "s", so shift-S is just pressing the keys my fingers are already resting on.

Your pinky rests on the shift key? My touch-typing teacher would have smacked my fingers with a ruler. :)
I guess it's a habit from using the left Shift (and left Ctrl) a lot more frequently than the "A". If I just used the keyboard for writing text, perhaps resting on "A" would make more sense for me.
Nothing wrong with that! Some of us were indoctrinated to rest our hands in a certain way, no matter what kind of typing we do. :)
ce - change to end of word (consecutive identifier chars or consecutive punctuation)

cE - change to end of WORD (consecutive non-whitespace chars)

Those are probably the most common for me because I tend to navigate by word/WORD in a line with w, b, W, B.

I need to get in the habit of using those. I tend to do ct<space>
Been using vim for 20 years and didn’t know some of these, thanks.
I use cw and Cw a lot, but the point is made, c is more useful than "some delete op" + "insert mode".
I think you meant cW. Cw deletes 'till end of line then inserts a "w".
I think 3 pedals are suggested: I, i and A
I've been using Vim regularly for the last six years and I still learn new, basic things.

Thanks for that.

Moreover, where is the concurrency? I mean, you cannot start typing until you're in insert mode.

The i<text>ESC are serialized.

How is it faster if the i and ESC are foot operated? You can't start typing until the pedal is down. You can't lift the pedal until you've finished the entry, and you can't give a command until the pedal is up.

C??? And I've been doing c$ for years like a chump!
I’ve been using $a, well ESC $a just to be sure
To add to this ci works for all sorts of things like [ { < “ ‘ etc.

There’s also di (delete in) and vi (visual select in) and probably a ton of others that I don’t know about. I’ll never know all of the wonderful ways to use vim

And cit inside (html, xml) tags. And then there's a for around -- cat, daw, >a{...
ci also can take a number for nesting level. For example, c2i( will change within the second level of surrounding parens rather than the innermost
Neat. I’ve got a similar project myself, but for I’m using an Arduino Pro Micro (Atmega32u4), which emulates a standard keyboard. Program it to send your chord of choice when pressed.

I’m planning on using mine as a mute button for conferencing. Last major hurdle is trying to get the global hotkey configured to send a different keystroke to my conferencing app.

I use a foot pedal for copy and paste operations when I want to give my hands a rest and to distribute heavy editing duties over to my feet when the occasion arises.

https://superuser.com/a/1486751

HolyDoly! This is exactly what I want. Thank you!
Forget the clutch, clearly a transmisssion stick is the correct device here. It's inherently modal!
I'd rather map it to the spacebar, so I can hold it down to stay warm in the winter.
Years ago I learnt about a stock dealing company in my country which was experimenting with pedals for their operators. Sadly, I cant't find a link now. But I found that interesting. Could be useful on certain applications in which users have to quickly respond to unexpected events by switching to particular tasks (without having to search for them through ALT+TABbing). I don't know, just speculating here.

I like it, probably wouldn't use it on Vim, but I see potential in other applications.

(comment deleted)
Thank you for posting this and giving me a reason to reread my all time favorite greentext: https://i.imgur.com/WLzeQMj.png
I know the image post in your comment exaggerates the Emacs input sequence for humorous effect but I got curious and decided to count the actual keystrokes for a real world common use case.

Say, we want to replace one string with another, e.g., "foo" with "bar" as it appears in your image post. So assuming that we need simple string replacement, not regex-based replacement, and also assuming that we have vanilla Vim, vanilla Emacs, no customization, and US layout keyboard, Emacs seems to be at par with Vim.

On Vim: <Shift>+; (:) <Shift>+5 (%) s/foo/bar/g <Enter> (16 key strokes)

On Emacs: <Alt>+<Shift>+, (M-<) Alt+Shift+5 (M-%) foo <Enter> bar <Enter> <Shift>+1 (!) (16 key strokes)

Now I know some of you might observe that I have not counted the initial <Esc> to escape to normal mode and the final i to enter insert mode again in Vim. That is correct, however, I find that experienced Vim users keep themselves in the normal mode most of the time. The normal mode is really the normal mode and the insert mode is a special mode that they get into for short periods of time to insert text. Also, they rarely use i to enter insert mode. Instead, they usually o, O, a, A, I, c<motion>, c<text-object>, etc. to enter insert mode. Then they return to normal mode again as soon as they are done inserting text, so I don't think it is fair to count the overhead of <Esc> and i while counting Vim key strokes.

Consider remapping ';' to ':' if you use vim a lot. Something like:

  " Use ; rather than : for commands
  nore ; :
  nore , ;
See, I never understood these tips. If I use Vim a lot I will build muscle memory. If I build the muscle memory with these adjustments I’ll just keep tripping over myself whenever I edit a file on a station without those adjustments. And simply foregoing the shift key isn’t even that much of a time or effort save.
This. I really like the pedal idea but I won't ever get it cause I don't want to have to move around with it.
I personally spend a lot more time at my own machine than at anybody else's, so the rare muscle memory fault while deep in SSH bothers me a lot less than uncomfortable defaults.
Totally agree with this.

For me, editing is like using a musical instrument; you want to get to the point where you're not using much conscious thought to do things quickly. How you do that doesn't really mater to much.

Many years ago (10 maybe?) I switched to the Colemak layout to help with an RSI. That messes up the vi home row navigation keys.

For a while I tried remapping jkl but since that's not very portable to other vi-like software on my own machine.

I gave up and just used muscle memory for new locations of those keys. That works surprisingly well for me.

I like Vim but I'm pretty sure that a competent emacs user would have very similar relationship with its keyboard interface.

Or with a regular text editor:

Shift+ctrl+<- bar

Way easier than either vim or emacs

Regular search?

I do '/ bar' on my emacs setup (Doom)

Adding further to my previous comment: What if we really need to do regex, say replace "f.." with "bar"? The input sequences then look like this:

On Vim: <Shift>+; (:) <Shift>+5 (%) s/f../bar/g <Enter> (16 key strokes)

On Emacs: <Alt>+<Shift>+, (M-<) Ctrl+Alt+Shift+5 (C-M-%) f.. <Enter> bar <Enter> <Shift>+1 (!) (17 key strokes)

Although, the number of key strokes are close to each other for both Vim and Emacs, I am pretty sure most beginners would feel there is a slightly increased cognitive overhead involved in Emacs when compared to Vim. The Vim input sequence is just : to invoke the command line mode, followed by an ed-style substitute command. However, the Emacs input sequence is M-< (beginning-of-buffer), C-M-% (query-replace-regexp), pattern, replacement-string and ! (to prevent further prompts). For an experienced Emacs user, all of this becomes muscle memory and becomes as efficient, if not more, as the Vim equivalent pretty soon.

Also, there is evil-mode in Evil for those who really want the Vim-editing experience along with the power of extensibility that Emacs offers.

When you spend hours in your editor, day after day, you aren’t a beginner for long
That’s unfortunately not my experience from observing other engineers. Many get stuck at a “good enough” level with their tools and never seem to learn the shortcuts which would allow them to code and edit faster.
Yes, that's exactly my experience with Emacs - I read their tutorial to do basic tasks (open files, open windows, switch windows, basic replace). Also, I never learned to use their "smart" (?) terminal, python console...

Otoh, then I tried Pycharm community, and eventually redeemed my github student pack for free pro version, and now I can't imagine living without it. Also there's a great plugin that annoys you with small non-modal popup in LB corner whenever you use mouse and reminds you of the correct hotkey

> Alt+Shift+5 (M-%)

You meant “Control+Alt+Shift+5 (C-M-%)”.

Oops! Copy-paste error. Fixed it now. Thanks for telling.
That would explain the off by two counting error.
> Ctrl+Alt+Shift+5

My fingers just broke reading that. Having said that I don't have a right alt key, as it's altgr . I suppose it's advisable to have two alt keys to use emacs.

I think people mash all 3 control keys with the left hand and reach across for the 5, or stretch their fingers very awkwardly and do all four. We’re into Rachmaninov territory at that point.
One can also invoke the query-regex-replacep functionality by its name instead of the key sequence C-M-%. For example: M-x q-r-r Tab Enter. The Tab key autocompletes the partially entered name q-r-r to query-regex-replace. This is going to be a lot more convenient for those who want to avoid the four finger chord.
(comment deleted)
> On Emacs: <Alt>+<Shift>+, (M-<) Ctrl+Alt+Shift+5 (C-M-%) f.. <Enter> bar <Enter> <Shift>+1 (!) (17 key strokes)

I get 19 here, and a lot more keys off the home row. Four keys at once is quite a bit slower for many people than two or even three.

> I get 19 here,

Here is the key stroke count I get expressed in a step-by-step manner:

   ;; Type M-< (Alt+<) to invoke beginning-of-buffer:
   1. Alt
   2. Shift
   3. ,

   ;; Type C-M-% (Ctrl+Alt+%) to invoke query-replace-regexp:
   4. Ctrl
   5. Alt
   6. Shift
   7. 5

   ;; Enter the regexp pattern "f.." at the prompt:
   8. f
   9. .
  10. .
  11. Enter

  ;; Enter the to-string "bar" at the prompt:
  12. b
  13. a
  14. r
  15. Enter

  ;; Type ! to replace all matches in the buffer:
  16. Shift
  17. 1
> and a lot more keys off the home row. Four keys at once is quite a bit slower for many people than two or even three.

Yes, indeed. The Emacs default key bindings are not the most ergonomic ones. To be fair though, the more common operation is M-% (Alt+%) which is a three finger chord.

Also, if one dislikes a four finger chord, there are other alternatives. For example, https://news.ycombinator.com/item?id=26435874 . Or one can customize Emacs and map regex-based replacement to a more convenient key sequence.:

  (defun query-replace-regexp-from-top ()
    (interactive)
    (goto-char (point-min))
    (call-interactively 'query-replace-regexp))

  (global-set-key (kbd "C-c C-r") 'query-replace-regexp-from-top)
With that, the key sequence is now C-c C-r f.. <enter> bar <enter> ! which is 13 key strokes. I know I am violating my own assumption of "no customization" in this thread so far. If we allow customization, both Vim and Emacs can do very amazing things.

Having said that, I just use C-M-% when I do need regex-based search and replace. Otherwise, for most situations M-% suffices.

By the way, I am not claiming in my comments that the default Emacs key-bindings are superior to Vim. If we go back to where this thread started (https://news.ycombinator.com/item?id=26431864), I was only trying to show that a simple string replacement in Emacs is not as ridiculously complicated as the humorous image post in that comment made it out to be.

In my experience, the vanilla Vim key strokes are more convenient in some areas (e.g., o, O, gg, G, etc.) and the vanilla Emacs ones at other areas (e.g., C-x C-o for delete-blank-lines, M-\ for delete-horizontal space, M-q for fill-paragraph that I like quite more than Vim's gqq or gqap). If we talk about key sequences only, I don't think there is a clear winner. But if we start talking about functionality, extensibility, and customizability, that would be a whole different discussion where Emacs has a lot to offer.

There's is also replace-regexp which doesn't ask for confirmation but doesn't have a default keybinding.
> On Vim: <Shift>+; (:)

    nnoremap ; :
I've never missed the default behaviour of ";" (to repeat the last "t"-like command), and the above has helped me tremendously
I, on the other hand, use ';' quite heavily:

  void theWorldsLongestFunction(int way, int too, int many, int parameters);
Then,

  0f,;;;
Is my self-approved way to jump through the parameters.
I use ; a lot.

However I don't mind using shift as I always press it with the opposite hand to one that's pressing the key to be shifted.

I also use a lot insert mode Ctrl commands.

I think any keyboard interface that you can use without looking at the keyboard is Ok by me.

I would probably be happy enough in emacs even with all the weird cording but I'm just too wedded to Vim at this point to want to change.

Emacs users consider a keychord as a single action so that would be 2 keychords plus the foo <Enter> bar <Enter> for a total of 10 actions.
Except the emacs sequence will get you tendinitis in the long run, won't it?
That's why your rebind Caps Lock to act as your foot pedal.
It depends on the usage, I guess. I have been using Emacs with its stock key-bindings for more than 10 years. I don't even remap my Caps Lock to behave like Ctrl like many others do. Yet I have never felt any issues due to repetitive strain yet. I do touch-type though which means I use the left Ctrl/Alt/Shift key while typing a key on the right side of the keyboard and I use the right Ctrl/Alt/Shift for typing a key on the left side of the keyboard. Maybe that distributes the repetitive strain evenly to both hands.

In the Emacs world, while remapping Caps Lock to Ctrl helps in reducing strain for many people, it also causes strain for some people. Every time, this discussion comes up in the Freenode #emacs channel, I have always noticed someone mentioning that remapping Caps Lock to behave like Ctrl caused them RSI.

Surprisingly, I did suffer from pain due to repetitive strain under the base of my forefinger once which seemed to be linked to overuse of mouse. The repetitive clicking, dragging and dropping in the Windows world nearly 10 years ago had taken a toll on my right hand forefinger. Taking inspiration from how we use keyboard with both hands, I then taught myself to use mouse with both hands (alternating between left hand and right hand every hour or so) and the pain gradually disappeared.

Yes, that's why I use Vim and not Emacs. Much easier on the hands.

I also avoid using hjkl all the time and use the arrow keys to counter RSI.

Personally, if my cursor was on the "foo" I'd probably use:

  *gcn<bar>.
That is:

  * (highlight all occurrences of foo)
  gcn (globally changes the highlighted pattern)
  <bar> (the text you want to replace with)
  . (repeat the command as many times as you want).

If you know you want to change all the occurrences at once you can highlight "foo" with * (shift-8) and then use :%s//bar/g as it will be set as the last regexp.
Once I tried Vim because everyone says it's faster, but I found that to be exaggerated. For example:

save in Vim:

  [esc] : w enter
3 or 4 keystrokes involving two hands.

save in emacs:

  C-x-s
one 3 fingered chord with the left hand.

And the chords can be hit much faster than key sequences.

If you're using Vim or Emacs with the default configuration you're wasting most of the potential. Add `map <C-x><C-s> <Esc>:w<CR>` to your .vimrc and now you have the exact same C-x-s shortcut in all modes. Although I personally prefer Alt-s(`<A-s>`).

Vim can be much faster because it can be adapted to the user. For me that's the whole point of using it, otherwise I might as well just use VS Code and curse at the annoyances every day.

Nano: M-R f o o Enter b a r Enter A

11 keystrokes.

Also note that with newer Emacs version there is project.el, where all you have to do to replace all instances of "foo" with "bar" is:

<Ctrl> + x + p + r "foo" <enter> "bar" <enter>

which are 12 keystrokes, if I'm not mistaken, and does more.

Hence the EMACS name: Escape Meta Alt Control Shift.
When I w' lad everyone knew it stood for Eight Megs And Constantly Swapping. ;)

I'm pretty sure though that Emacs is actually short for Editor MACroS.

A nod to the fact that Emacs is really an extensible Lisp system rather than just an editor or IDE.

As far as I know E was just the name of an extensible editor back then, and the very first thing named Emacs was a useful collection of custom macros. And then followed various reimplementations of the whole program until one written in C stuck around.
E-macs doesn't have two extra leopards, it has exactly the correct number of leopards ALL THE TIME!
Is there a Vim speed editing contests? I'd love to watch one. And Vim vs Sublime Text too :)
There should be. That’s a great idea
Suddenly I'm imagining a huge stadium filled with vim-users, watching a duel between to vim-masters — e-sport-style. Would actually be fun to watch!
Okay, so what are some other cheap ways to have more input methods without lifting my hands off the keyboard?
For me, I would reduce the functionality to just one key: ESC. I always pressed ESC key mindlessly when thinking of the next thing to write. I pressed too many useless ESC like fidgeting. If I can offload it to the foot...
so what will happen if you press keyboard i in command status?