Search code examples
vimctags

how to list up visited file-line locations while browsing with vim?


I think I knew this but forgot. I tried :ts or g] but it doesn't work as I want.

Many times I use vim to analyze source codes. I use gf (when cursor is in a file name, if I press gf, the editor opens the file), or g] or ctrl-t a lot. (with tags file generated by ctags, when cursor is on a variable or type name, pressing g] jumps to that location, letting me select from candidates when there are many candidates, and ctrl-t makes me go back.)

After many such operations, sometimes I want to go back to a specific {file,line_number} location that I recently visited. (gi, go incrementally goes forward or backward).

I forgot, but for this purpose, there is a command to list up the locations showing the locations, my current location shown in the middle so I can choose from +3 or -2 (0 is my current location). What is that command? (Just doing :rew goes to the first file.)


Solution

  • (gi, go incrementally goes forward or backward)

    gi and go don't do that. You must be thinking about <C-i> and <C-o>, which get you through the "jump list".

    The command you are looking for is :jumps and it is documented under :help jump-motions, like <C-i> and <C-o>.

    (Just doing :rew goes to the first file.)

    Indeed, the argument list and the jump list are totally unrelated.