3 ms·
Every time someone brings this up, I think "oh right, I could do that" and then immediately forget. Especially if you can type quickly, it's easier to just "dri
by userbinator 2mo ago
Every time someone brings this up, I think "oh right, I could do that" and then immediately forget. Especially if you can type quickly, it's easier to just "drive straight ahead" with the command you want, than add another "mental branch" to interrupt the flow. For the same reason I'll often Ctrl+C and start again instead of trying to backspace and correct.
- adityaathalye 2mo agoAs an Emacs using degenerate, `M-.` is my friend. `!` is too awkward on the keyboard.
- pcblues 2mo agoI guess you could map it to the right-hand M key?
- adityaathalye 2mo agoNot while I've my keys mapped as the Lords of Lisp intended. Thumbs are always on the `Ctrl`s... https://en.wikipedia.org/wiki/Space-cadet_keyboard https://en.wikipedia.org/wiki/Space-cadet_keyboard
- squigz 2mo agoAs someone who can type rather quickly, I disagree. It can take some time to internalize, but once you do, it's much faster. Same with Ctrl-C - once I got used to navigating by word instead of by character to correct things, it became much faster than starting over.
- Retr0id 2mo ago"sudo !!" is quite firmly burnt into my muscle memory, but the whole rest of the time when I type an exclamation mark I mean it literally, and I get annoyed when it turns into a syntax error of some variety.
- moring 2mo agoWorse, the "press up-arrow to get the previous command, then fix the errors in it" flow is broken when an exclamation mark causes a syntax error.
- zcw100 2mo agoI like to alias it to "please"
- Fnoord 2mo agoOh, nice. I alias'ed it to please as well. But because I use fish, I had to do this: alias please 'sudo (history -1)'
- mkl 2mo ago> For the same reason I'll often Ctrl+C and start again instead of trying to backspace and correct. Try ctrl-x ctrl-e to edit the command in your choice of editor ($EDITOR). Editing commands is not hard with a few keys. At least learn alt-b and alt-f to go a word back or forward. Often ctrl-left and ctrl-right will do the same thing easier (depends on your terminal). Ctrl-w deletes back to the previous space, alt-backspace and alt-d delete the previous and next word respectively. There are many more keys in the manual, but those cover most things.
- _doctor_love 2mo agoGreat advice. On the Mac, make sure to set up Alt/Option as "meta key".
- userbinator 2mo agoSo instead of just retyping the command (much less than 1s), I have to remember to open the editor, and then think of how to edit it, and then execute those steps? Hell no. At that point I'll have long lost my original train of thought. The original command, and at least the subsequent one, are already in my mind and can be output immediately. Any deviations from that plan are going to be much slower. ctrl-x ctrl-e Just thinking about that almost makes my fingers hurt. A chorded sequence of two keys, same side of the keyboard, nearly in a vertical line on the top and bottom row, is basically the slowest and most awkward possible combination to type.
- db48x 2mo agoOnly because you’re typing it incorrectly. Use both hands. One presses the modifier, the other types the letter. That's why you have modifiers on both sides! C-x means to use your right hand to hold down control, while using your left to type the x.
- userbinator 2mo agoX E is still a terribly slow sequence to type.