this post was submitted on 17 Oct 2025
21 points (95.7% liked)

GNU+Linux Humor

5479 readers
1 users here now

Memes, jokes and general humor about GNU+Linux

Rules:

founded 6 years ago
MODERATORS
 

I've noticed that people older than me have always known just a few more vi commands than I do.

I'm in my 40s, so clearly I know about 4:

Writes and quits (I consider these variants of the same thing):

:w
:q
:q!
:wq
ZZ

See the line numbers: :set number

Delete everything from top to bottom (must be at top, easily remembered by mumbling duck, duck, duck, GOOSE): :dddG

Search for a string: /

And that's probably it. I think I used to know how to cut a line and paste a line, but I'd have to look it up to be 100% correct on the syntax.

Anyone in their 50s or 60s care to add to this dazzlingly long list of inadequacy? Not looking for a cheat sheet or the man page :-p

you are viewing a single comment's thread
view the rest of the comments
[โ€“] TechLich@lemmy.world 3 points 3 months ago (1 children)

I know a few more interesting ones but nowhere near what actual vim people know.

  • d, y, p - delete, yank, paste as others have said.
  • r - replace the character under the cursor with something else
  • g - go somewhere (gt is go to next tab which you can open with :tabedit )
  • v - visual mode for selecting text to yank with y
  • c - change - deletes a thing and goes to insert mode, like d but not. Eg.
    • cc - change the current line
    • cw - change the next word

My favourite is ci - change inside

ci" - changes all the text that's inside the next set of quotes.

ci( changes the text inside the next set of parentheses. Etc.

I also use :mouse=a which I'm told is sacrilege but sometimes I like to click on a thing!

Ooh nice ci is a new one for me, gonna try to encode that one

you can also parameterize the change word command, e.g. c3w will delete the next three words and put you in insert mode. it's handy for changing multiword variables or paths.