The q command records macros, which means that it will record your keystrokes and later you can run this macro to repeat that series of keystrokes in one go.
After you type the q key, you have to type another letter.
This letter will be where the macro will get set to so you can later run the macro.
You'll see at the bottom of the screen:
To stop recording you press the q key again.
And to run the macro you hit the at sign @ followed by the key / letter you saved your macro to.
If you want to repeat the last macro you did, you can use the @@ shortcut to repeat it.