Back to tips

Navigate Code with Vim Tag Stack

Jump through definition history with dedicated tag navigation commands

shortcuts intermediate January 29, 2026 · zenazn
#vim #navigation #go-to-definition #workflow

Vim users rejoice! Zed now supports tag stack navigation - a dedicated history for “Go to Definition” jumps. Instead of mixing definition jumps with your regular navigation history, they’re tracked in a separate stack.

How It Works

Every time you use “Go to Definition” (or hover links), Zed records:

  • Origin: Where you jumped from
  • Target: Where you jumped to

These are stored in a separate tag stack, independent of your regular back/forward history.

Use these new commands to navigate the tag stack:

  • pane: go to older tag - Jump back through definition history
  • pane: go to newer tag - Jump forward through definition history

Why It’s Better Than Browser History

Traditional browser-style history: When you go back, you wade through every cursor movement, search, and file switch.

Tag stack: Only tracks definition jumps, so going back takes you directly to where you started the investigation - not through every intermediate step.

Example Workflow

1. Working in app.tsx (origin)
2. Cmd+Click on UserService.login() → jumps to service.ts
3. Cmd+Click on authenticate() → jumps to auth.ts
4. Cmd+Click on validateToken() → jumps to token.ts

Now use "go to older tag":
- First press → back to auth.ts
- Second press → back to service.ts
- Third press → back to app.tsx (your original location)

For Vim users, consider mapping to traditional Vim tag bindings:

{
  "context": "VimControl && !menu",
  "bindings": {
    "ctrl-]": "editor::GoToDefinition",
    "ctrl-t": "pane::GoToOlderTag"
  }
}

This brings familiar Vim tag navigation to Zed!


Related PR: #46002