What does "mapping" mean in this case, and what are the advantages between the two approaches?
It means that when you press
Q, vim reacts as if you had typed
gqip. The advantage of this is that you can create whatever keyboard shortcuts you like and use vim the way that feels most naturally to you.
Is it possible to change
ggq and if so how?
Yes, absolutely. Either one of these should do it:
:nnoremap gqG gggqG
:nnoremap ggq gggqG
Also, I would recommend putting both this mapping and the
that you mention in your
.vimrc. Basically just add all of these lines to a file named
.vimrc and save it in your home directory, then vim will automatically run those commands when you launch it, so you won't need to run those commands everytime you open vim. Then you can format with just
gggqG or whatever you map that to rather than typing it all out each time.
Also note that you won't need the colon if you add these lines to your vimrc. This:
nnoremap gqG gggqG