How do I jump to a tag definition using the tag stack?
Answer
<C-]>
Explanation
The <C-]> command jumps to the definition of the keyword under the cursor using tag files. This is a core code navigation feature when working with ctags.
How it works
<C-]>looks up the word under the cursor in the tags file- If found, it jumps to the file and line of the definition
- The previous position is pushed onto the tag stack
Example
result = calculate_total(items)
With the cursor on calculate_total, pressing <C-]> jumps to where calculate_total is defined.
Tips
<C-t>pops the tag stack and returns to the previous position:tag function_namejumps to a tag by name- Generate tags with
ctags -R .in your project root :tselectshows all matching tags if there are multiple