Skip to content

Editor: Go to Next/Previous Change in file without opening diff editor #310397

@Nedunchezhiyan-M

Description

@Nedunchezhiyan-M

Feature Request

Problem

VS Code shows git change markers (gutters) in edited files, but navigating between individual changes requires either:

  • Opening the full diff editor (overkill for quick navigation)
  • Scrolling manually and eyeballing the gutter markers
  • Using the diff editor's navigation buttons (requires a mode switch)

There is workbench.action.editor.nextChange / workbench.action.editor.previousChange but these only work when the diff editor is focused, not in the regular editor view.

Proposed Solution

Add commands that navigate between hunks within the regular editor view:

  • "Go to Next Change in File" — navigates to the next git hunk in the current editor (default: Alt+] or ]c in vim-style)
  • "Go to Previous Change in File" — navigates to the previous git hunk (default: Alt+[)

These should work the same as ]c / [c in vim's diff mode, or the "next change" buttons in JetBrains — navigating to the start of the next/previous changed section.

Behavior

  • Moves cursor to the first line of the next/previous changed hunk
  • Shows a small peek-style diff (similar to the existing inline diff peek that appears when you click a gutter icon)
  • Wraps around (goes from last change back to first)

Status Bar / Breadcrumb enhancement

Optionally show change count in the file in the status bar: ⟳ 3 changes — clicking cycles through them.

Why This Matters

Quick in-file change navigation is essential for code review workflows. Right now, reviewing your own changes in a file means either using the diff editor (heavy) or scrolling (slow). Navigation commands make change review snappy.

Related

  • Existing: Alt+F3 cycles through editor selections in multi-cursor mode — similar concept
  • Existing: The inline diff peek (clicking gutter) already shows the right UI — we just need keyboard nav to reach it

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions