this post was submitted on 19 Nov 2023
388 points (95.8% liked)

Programmer Humor

32054 readers
1745 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 18 points 10 months ago (9 children)

Question: why does nobody else save and exit with ":x" or ":x!"?

[–] Parabola 20 points 10 months ago (4 children)

Lots of people don’t know. Just like ctrl+r to substring search your command history in bash.

[–] [email protected] 13 points 10 months ago* (last edited 10 months ago) (2 children)

I seriously pity people who don't know ctrl+r that is one of the most important tools for productivity on the cli.

[–] [email protected] 9 points 10 months ago* (last edited 10 months ago)

And you can hook in fzf to it to get a proper list of previous commands all fuzzy matched!! Oh-my-zsh just requires adding fzf to your plugins list (:

I survived for years with just https://github.com/zsh-users/zsh-autosuggestions which is similarly great, but fills a slightly different role. Just start typing and you'll see a faded preview of the most recent command matching & u ctrl+f to autocomplete it. Is gr8

e: clarified what zsh-autosuggest does

[–] [email protected] 1 points 10 months ago

I’ve found it’s a bit overrated honestly. Usually, I also need the commands before and after something, so I use history | grep -B N cmd instead

[–] [email protected] 4 points 10 months ago (1 children)

ctrl+r to WHAT

IM SO FUCKING PISSED OFF RIGHT NOW

[–] Parabola 1 points 10 months ago

LOL. I had the same reaction when I found out a decade ago.

[–] [email protected] 3 points 10 months ago (1 children)
[–] voodooattack 3 points 10 months ago

You can search your bash history with ctrl+r.

Pro tip: install atuin for the best experience.

[–] [email protected] 3 points 10 months ago

I just got moved to a new team, and my new team lead up arrow spams. I was about to tell him about ctrl-r, but he found his command, and I'm awkward, so I didn't say anything. Maybe next time.

[–] [email protected] 12 points 10 months ago

I guess by the time I came across :x, :wq was already too ingrained to bother switching.

[–] [email protected] 10 points 10 months ago* (last edited 10 months ago) (1 children)

No specific reason, but I'd rather be deep in the cold, cold ground before I quit with ":x" instead of ":wq".

[–] [email protected] 1 points 7 months ago

But... But :x is superior because it doesn't overwrite unchanged files with a new modified date :(

[–] eran_morad 7 points 10 months ago

Whoa. I’ve been doing :wq for like 25 years and never new about :x.

[–] [email protected] 4 points 10 months ago
[–] [email protected] 4 points 10 months ago* (last edited 10 months ago)

I was quite habituated with :x/:x!, but after switching to Kakoune, I use :wq/:wq!, because :x/:x! does not exist. Yes, it's one extra key, but I like the overall reduce in cognitive overhead.

[–] [email protected] 4 points 10 months ago

It's such an awkward letter to reach, also I'm stuck in my ways leave me alone

[–] Strider 1 points 9 months ago
[–] [email protected] 1 points 10 months ago

What am I, a farmer? /s