I use macros way more often than dot. With a macro I can include the movement action of getting to the correct position before the edit takes place, I'm not sure if this can be done with the dot key alone.
Whether one uses . or a macro (manual or recorded) should depend on the current situation. It's really not a "pick one and stick with" it kind of situation.
I agree, so many ways to do it it’s horses for courses.
Eg from the first “pick” you could press * to highlight occurrences and move to the next one use cw to change it to “s” and bounce on n to move to the next one you to squash and use . to repeat the change.
That’s visual and lets you decide which commits to squash.
If I wanted to squash all the other commits I’d probably use visual block and } instead, but that’s just me.
For a case like that, I'll use rectangular block mode--it's really fast and intuitive, so I'll usually pick that over :s/a/b/g if it's applicable.
The whole thing would be something like <ctrl-v>5jecs<esc>. Ctrl-v starts rectangular block mode, go down 5 lines and to the end of the word, change selection to "s", return to normal mode.
to replace "pick" at the start of line with "s" on all lines?
If you execute it once in vim you can recall it later with just typing
:%↑
and confirm with Enter.
As for the top of the file:
gg
I use the mnemonic "go go line" (as in Inspector Gadget's "go go gadget") and since you can prefix it with a line number (e.g. 4gg to go to line number 4), leaving it out gets me as close to line number nothing^Wzero as possible, i.e. line 1.
HTH :)
PS:
the % says "on all lines"
your trailing "/g" would make it match&replace "pick" multiple times on the (current, since % is missing) line
PPS:
As an aside, I use "vim somefile +N" all the time to open somefile at line number N;
especially when there's an error message in the form "error at somefile:N" by
typing vim, then double-click-middle-click copy&pasting "somefile:N", Ctrl-E to jump to the end and replacing ":" with " +".
I really should write a shell function for that...
> Shift+G takes me to the bottom of a file, but I don't know how to get back to the top :D
I know the complement to Shift+G, it's gg. But I can never remember which one goes to the top and which to the bottom, so half the time I press both. :)
Thank you everyone for the _really_ helpful responses!
It is immediately apparent to me that my interaction with vim has been heavily informed and limited by my preconceptions and previous text editing experiences.
Time to start engaging with vim as its own entity, with its own conventions and idiosyncrasies.
G takes a line number as its "object" like other vim commands. So 1G is the first line, 10G the tenth, etc. G is the last. (0G goes to the last line too.)
Well I see that finally I did my programmer life learning only switching insert mode / edit mode, maybe 5 commands like A x etc...,and :q or :wq!