Live data from Hacker News

Vim Clutch – A hardware pedal for improved text editing (2012)

github.com

151–160 of 171 posts

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#151
post #125
post #123

Earlier quoted context omitted.

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

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#152
post #107

Earlier quoted context omitted.

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: +; (:) +5 (%) s/f../bar/g (16 key strokes) On Emacs: + +, (M- bar +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…

> On Emacs: + +, (M- bar +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-
> 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.. bar ! 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.

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#153

Earlier quoted context omitted.

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

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#154
I developed the "muscle memory" to use vi decades ago, and have been able to use it ever since, with minor hiccups like too-small ESC keys and the CTRL key moving to its present position on PC keyboards. vi everywhere. On the Amiga I used to have, on Unix boxes of all kinds including an ancient V7 one I played with for a while ("elvis" barely fit), over dialup terminals, over Raspberry Pi serial consoles, everywhere.

If instead you invest muscle memory in a custom hardware assist device, it's lost when you don't have that assist device. Getting used to insert mode vs. not insert mode is really not so bad.

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#155
post #146
post #95

Earlier quoted context omitted.

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

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 :w` to your .vimrc and now you have the exact same C-x-s shortcut in all modes. Although I personally prefer Alt-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.

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#156
post #139

Earlier quoted context omitted.

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.

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#157
post #44

Earlier quoted context omitted.

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 , you can do `:map ` to make it behave exactly the same.

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#158
post #53

Earlier quoted context omitted.

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

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#159
post #31

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

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…

I use an autohotkey script to do that, on holding down space. Instant vim everywhere!

Re: Vim Clutch – A hardware pedal for improved text editing (2012)

#160
post #65

Earlier quoted context omitted.

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?
Post reply on HN