Tip 104 | Navigate Keyword Definitions with Vim’s Tag Navigation Commands |
Vim’s ctags integration turns the keywords in our code into a kind of hyperlink, allowing us to jump rapidly to a definition. We’ll see how to use the Normal mode <C-]> and g<C-]> commands as well as their complementary Ex commands.
Jump to a Keyword Definition
Pressing <C-]> makes our cursor jump from the keyword under the cursor to the definition. Here it is in action:
Keystrokes | Buffer Contents | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{start} |
| ||||||||||||||
<C-]> |
|
Get Practical Vim, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.