DEV Community

Discussion on: Stop pressing the up (arrow) to find a previous command

Collapse
 
rodrigograca31 profile image
Rodrigo Graรงa ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป๐Ÿ› • Edited

I can see you still use Bash.....
poor kid... I feel for you ๐Ÿ˜ข ๐Ÿ˜‚

  1. You can use !! to get the last command really quick. or !cat to run the last command that started with cat
  2. You can press the up arrow and move your right hand up and press Home to go to the beginning of the line way faster than pressing "command-f" not to mention that its Mac specific ๐Ÿคฎ.
  3. You can use CTRL + LEFT/RIGHT (maybe its Option for you Mac users) to skip one entire word. ๐Ÿ˜ It works for all programs and OSs. Not only your terminal. And I mean ALL!!!! Same goes CTRL + HOME/END
  4. If you used ZSH (instead of Bash) you don't even need to know a given command was your last, you can get anything from your history really quick by starting to type it and then accepting the autocomplete with a RIGHT arrow click. I use this so often! I know I have used scp in the past so I just start writing scp hit RIGHT and it literally types 102 characters for me instantly. (note: this is a plugin called "zsh-autosuggestions") (btw, if you are on a Mac๐Ÿคฎ๐Ÿ˜‚ why are you on bash? didn't they switch? you didn't update your Mac? ๐Ÿ˜ฎ๐Ÿ˜ฑ)
  5. If you are using VS Code install Cameron.rerun-last-command and then You can just press CTRL + 7 again and again, to do !!. Thank me later ๐Ÿ˜‚
Collapse
 
wulymammoth profile image
David • Edited

You do realize that zsh is not installed on remote machines. Right? Are you familiar with the differences between zsh and bash and the subtle idiosyncrasies? Probably not, but they matter. I work on remote machines that don't have zsh, silly.

I'm a little insulted by your assumptions. I actually do use zsh on a different machine (it's the default on new Macs), but I've also used it in the past along with oh-my-zsh, Prezto (for a long time ~5 years), and fish (short time).

  1. Sure. How is that different from up or ctrl-p and the requirement on two keys? Can, but do you? The ! commands, by default, don't provide a visual indication of that last command, so you're running it blindly, so it's utility is diminished

  2. I can't help but laugh. Do you know why? You completely misread. None of these commands are Mac-specific. And where is the "command" key mentioned? I just mention option/alt (alt for non-Mac). But anyway, carry on. Not everyone uses a 100% or 150% keyboard like yourself and packs a mouse when traveling. But, go ahead, bring your desk, too. While you're at it, maybe a floppy disk with all your dependencies in case there isn't wifi. I have a 60% keyboard that is portable for travel. It doesn't have home, end, or arrow keys. Wait. Did I mention readline shortcuts? Oh, I did! Did you read? No. They are not Mac-specific. I still have a PC with both Windows and a Linux distro on it. While you're over there moving your hand off the keyboard searching for your home, end, and arrow keys, and greeting your home row again, I'm pressing ctrl-a (beginning of line) and ctrl-e (end of line). LOL! Silly silly, you. Again, I would advise you to read before you make remarks like this. Your lack of reading shows -- didn't I say that readline shortcuts are not terminal and bash-specific? Nor are they Mac-specific. Go ahead, I'm waiting... for you to give yourself a face palm...

  3. Again. Read my post in its entirety -- same as point 2 that I'm making... readline shortcuts.

  4. If you use Windows instead of a terminal, you don't even need a keyboard! Why type text when there's a GUI? See the hilarity in how you make assertions? Well, damn. I didn't know this. I've never used zsh ๐Ÿคทโ€โ™‚๏ธ. You must have many friends. I can see the dependencies bleeding into your life -- plugin this; plug in that; plug a floppy disk with zsh into the remote connection... Are you familiar with the Unix philosophy? It's worth a read. I avoid having more plugins than I need. I'm not telling people what to use (despite the title/clickbait). I'm just providing options that are nearly universal across platforms. zsh is not the default shell on every Linux distro. zsh is DEFINITELY more convenient. And the way that you use zsh is slower compared to me. ctrl-r, type command, and enter as you dance between sets of keys. Bless you, child! (see what I did here? I inverted our relationship). The visual auto-completion is nice. I miss that when I'm not on my machine with zsh.

  5. Yeah, you should really read before you comment. LOL. I don't use VSCode. I use Vim. You're bleeding, "I'm way cooler than you" attitude which I'm sure makes you many friends.

Lastly, I'm already certain that I'm slower in my shell than you are and I only type one word per minute, because why be in such a rush when enjoying life on a beach? Speed kills. I'd rather slow down and experience it :)

Collapse
 
rodrigograca31 profile image
Rodrigo Graรงa ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป๐Ÿ› • Edited

Seems someone didn't catch my jokes.
(Even with my heavy emoji usage ๐Ÿ˜…)

I guess I have to work on that. ๐Ÿคญ๐Ÿ˜‚

Thread Thread
 
wulymammoth profile image
David

Oh, I caught them... but they're not jokes. They're what is called, "back-handed" comments. If you had acknowledged or were aware of the alternatives as I've mentioned, then you likely would have mentioned them... but anyway, I'm sure that you learned a thing or two, even if you fail to acknowledge them or should I say, "my jokes"? ;)