You just blew my mind. sudo [space][shift] !! [enter] (4+1+1+1+1+1) is one keypress longer than ↑ + home + sudo + space + enter (1+1+4+1+1). In your face, universe.
Maybe someone who only used csh? I can’t remember if ^a is a default in that shell. I thought it started with ksh or bash.
ETA: just looked it up and I’m dumb. Comes from emacs (of course) and looks like it was introduced in bash. I guess I could claim ignorance, being a VI man, but I actually knew at some point that it came from emacs. I think I can count on 1 hand the number of times I’ve used emacs
Ayo chill
I approve of the ice to coke ratio. I am now chill.
Good
How about just one keyboard shortcut and enter.
Start with ctrl+p, ctrl+a but yes
Always amused me that
sudo !!is actually more keypresses (at least on keyboards where typing!requires holding Shift).You just blew my mind.
sudo [space] [shift] !! [enter](4+1+1+1+1+1) is one keypress longer than↑ + home + sudo + space + enter(1+1+4+1+1). In your face, universe.If you have an actual home key. If it’s ctrl+a or (IIRC, AFK) ctrl+← then we’re even.
And if we track hand movements then pressing ! twice may be faster than moving to another key.
But yeah, it’s not at all clear that
sudo !!is faster like you’d expect it to be.But it’s faster since your hand move less and you can keep
shiftpressedI use zsh with the sudo plugin. Double tap
escand your current or last command will be prefixed with sudo.I don’t dabble in black magic. /j
It’s actually pretty neat.
Ctrl A is easier to reach than the home key
Unless you’re in a default screen session (I always thought ^A was such a dumb default for screen to use).
Screen must have been written by someone who wasn’t familiar with the shell. It’s the only logical explanation.
Maybe someone who only used csh? I can’t remember if ^a is a default in that shell. I thought it started with ksh or bash.
ETA: just looked it up and I’m dumb. Comes from emacs (of course) and looks like it was introduced in bash. I guess I could claim ignorance, being a VI man, but I actually knew at some point that it came from emacs. I think I can count on 1 hand the number of times I’ve used emacs