this post was submitted on 26 Oct 2024
634 points (96.9% liked)

Programmer Humor

32410 readers
1 users here now

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

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Ephera@lemmy.ml 71 points 9 months ago (35 children)

Recently had to edit the hosts-file on a remote host, and I don't know if using two proxy jumps to SSH into it broke it, but it just wouldn't let me select text with the mouse.
I had to duplicate seven lines and edit the IP addresses, and without being able to copy-paste, I already saw myself manually typing it out.

Then I remembered that in Vim, you can do d5↓ to delete 5 lines. Surely that would also work with copying/yanking. And yep, a y7↓ and a paste later and I had duplicated the lines.

Then use the multi-line cursor like I routinely do for changing all 7 IP addresses...
...and now I feel like I've crossed the line where people will think I'm just a wizard.

[–] SpaceNoodle@lemmy.world 29 points 9 months ago (23 children)

Ctrl-K and Ctrl-U in nano, a sane editor that does not hate you

[–] eager_eagle@lemmy.world 30 points 9 months ago (12 children)

Ctrl-X Ctrl-V in micro, if you appreciate a sane editor with sane keybindings.

[–] fl42v@lemmy.ml 2 points 9 months ago (1 children)

"Sane" keybindings are questionable given Ctrl's location (painful to press with both pinky and thumb fingers). It's standard, I'll give it that, but those in helix or vim are mostly (I'm looking at you, navigation between splits) much saner all things considered

[–] eager_eagle@lemmy.world 1 points 9 months ago (2 children)

or maps your caps to Ctrl, like vim users map it to esc

[–] fl42v@lemmy.ml 1 points 9 months ago

Or build yourself a crkbd, yeah. That's beside the point.

[–] computergeek125@lemmy.world 1 points 9 months ago

Which is exactly where Sun Unix keyboards place it, in a same spot

load more comments (10 replies)
load more comments (20 replies)
load more comments (31 replies)