Allow line numbers to be rendered on the right side of the editor
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
### Problem
Line numbers are rendered exclusively in the left gutter, and there is no way to move them. For some workflows the left gutter is the wrong place for them:
- Code is left-aligned, so the eye is already anchored on the left edge. Numbers sitting between the window edge and the code push the code right and add a column of visual noise directly adjacent to the text you are reading.
- When referencing line numbers while reading toward the end of a line (long lines, wrapped prose, log files, minified or generated output), the number is at the opposite side of the screen from where you are looking.
- With line numbers off, the left edge is clean but the numbers are gone entirely — there is no middle ground.
### Why existing options do not solve this
`editor.lineNumbers` only accepts `on` / `off` / `relative` / `interval` — all of which render in the left gutter. `editor.glyphMargin`, `editor.folding`, and `editor.lineDecorationsWidth` change the gutter's contents and width but not its side.
Extensions cannot solve it either. The extension API only exposes gutter decorations (`gutterIconPath`) and `before`/`after` inline decorations. The "Double Line Numbers" extension (https://github.com/slhsxcmy/vscode-double-line-numbers) is the closest attempt — it renders a second set of numbers as SVG gutter icons — but both sets still live in the left gutter, and using it means giving up breakpoint glyphs. Inline `after` decorations cannot produce a stable right-aligned column because they follow the end of each line's text rather than a fixed column.
So this needs core support.
### Proposed solution
A setting controlling which side the line number column renders on, e.g.:
```jsonc
"editor.lineNumbersPosition": "left" | "right" // default: "left"
```
`"right"` would render the line number column against the right edge of the editor's content area (inside the vertical scrollbar and minimap), with the existing `editor.lineNumbers` modes (`on`/`relative`/`interval`) and `editor.lineNumbersMinChars` continuing to apply. The left gutter would keep the glyph margin, folding controls, and SCM decorations, so breakpoints and diff markers are unaffected.
Open questions worth deciding: interaction with the minimap and `editor.minimap.side`, and whether click-to-select-line on the numbers should move with them (it should).
### Real-world scenarios
- Reading long-line content (logs, generated code, CSVs, wrapped Markdown) where the relevant line number should be near the end of the line, not the start.
- Pairing / screen sharing where someone calls out a line number: with the numbers adjacent to the right edge, the number and the scrollbar position agree.
- Minimal editing setups that want the code flush against the left edge without losing line numbers entirely.
- Users coming from editors and terminal tools that allow right-side or configurable gutters.
### Prior art / related issues
Related gutter-configuration requests, none of which cover position: #91067 (gutter border), #30795 (gutter width), #135114 (content left padding), #13212 (hide gutter).
Contributor guide
Assessment
This issue has not been assessed yet.