I just learned that "gd" conveniently jump the cursor to the declaration of
the variable over which the cursor is currently located. However, I found
that it takes a bit of an effort to come back to where I used to be. It'd
be nice if I could jump "back".
Thank you,
Sang-Ho
Ctrl-O, then Ctrl-I to come back
'' returns you to the position before the latest jump. This is standard
vi, not just vim.
There are two related methods the double backtick `` and the double tick ''.
The double tick is line oriented. The backtick jumps to the line and exact
column where you were.
Also, use marks. Marks are named by letters. For instance typing ma remembers
the current location under mark a. To jump to the line containing mark a,
type 'a. To the exact location use `a.
Lower-case-letter marks are per-file. Upper-case-letter marks are global;
`A will switch to the file containing mark A, to the exact location.