In vim's normal mode, the g
prefix is used for a number of commands. Some commands go somewhere in the document, but other commands deal with file encodings and swapping upper/lower case letters.
ga
- show character encoding10gg
- go to line 10gg
- go to line 1gH
- start Select line modegr
{char} - virtual replace N chars with {char}
What is the missing connection between all these commands?
g
andz
extend the normal set of commands. – Benoit Oct 3 '11 at 12:14g
andz
as @Benoit: «g{C}
was defined because it is a command that is commonly needed, but other characters are already binded». Manyg*
have a mnemonicgo to
/global
, some not. Unlikeg*
z*
commands that are not related to folds are harder to remember for me. I even personally in one of my plugins defined a set ofgd
mappings that can be memorized asglobal diff
: «see all changes made by given revision». And near had a set of «go to» ones:gu
- «go to user» - «view changes made by user» and so on. – ZyX Oct 3 '11 at 20:5810gg
or10G
(or:10<cr>
). – Keith Thompson Aug 5 '14 at 20:45