You can set a mark on that line with the keystroke m' and come back to the same line later by hitting '' . VIM allows you to set more than one mark. To set a mark and store the same in a register say j, all one has to hit is mj . To go back to the mark one has to hit 'j . Multiple marks are really useful in going back and fro within a piece of code.
Marks can span across files.
If you want a mark which will take you to a different file then you will need to use an upper-case register. For example, use mA instead of ma . I'll talk about editing multiple files in a later section. The third example For some reason you've forgotten what y and z are and want to go to their declaration double quick. The gd keystroke stands for Goto Declaration.