I'm using find-tag
function M-. to jump to function definition, how can I jump back to previous location?
Ctrl-O is its complement, moving forward through the jumplist. gg jumps to the top of the file, so Ctrl-I then jumps back. The equivalent to Ctrl-I in Emacs would be C-u C-space .
The emacs editors can use the index file(s) produced by etags to search for a requested function name, defined name, or global variable, etc. Each of these search names are referred to as a tag. If the tag is found in the index, it will open the file containing the searched for tag in a new buffer.
To use ctags with emacs, you must supply the '-e' parameter to instruct ctags to generate an emacs tag file. The commands below are often sourced into a Makefile and then run with a CompileCommand. Ctags also has a recursive option, '-R' . This is the most common (and simple) usage.
M-. calls xref-find-definitions
in recent versions of Emacs. I use M-,, which is bound to xref-pop-marker-stack
, to return back. You can even use it to recursivelly return from a deeper search.
In older Emacs versions, M-. was bound to find-tag
which worked similarly. The inverse function was pop-tag-mark
by default bound to M-*.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With