Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Path Line Numbers FlexibleNew to Visual Studio Code? Get it now.
Copy Path Line Numbers Flexible

Copy Path Line Numbers Flexible

turweet

|
4 installs
| (1) | Free
Copy file paths with line numbers. Flexible configuration for paths, separators, and multi-line output.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Path Line Numbers Flexible

Copy file paths with line numbers, your way. Flexible configuration for path style (absolute/relative/tilde/file name), separators, and multi-line output. Includes a default shortcut and editor context menu.

A lightweight VS Code extension to copy file paths with line numbers with flexible settings.

Features:

  • Flexible path style: absolute, relative, ~, or file name only
  • Configurable path/line separator
  • Flexible multi-selection formats: range, list, per-line
  • Default shortcut + editor context menu

Perfect for code review, sharing snippets, and remote workflows.

Quick Start

  1. Open any file.
  2. Select one or more lines.
  3. Right click and choose Copy Path With Line Numbers, or press Shift+Alt+C.
  4. Paste anywhere.

Settings

Search for "copy path line number" in Settings UI, or edit settings.json:

{
  "copyPath.lineNumber.pathStyle": "relative",
  "copyPath.lineNumber.separatorBetweenPathAndLine": ":",
  "copyPath.lineNumber.selectionMultiLineFormat": "range"
}

Options:

  • copyPath.lineNumber.pathStyle: absolute (full path) | relative | tilde (~) | fileName (name only)
  • copyPath.lineNumber.separatorBetweenPathAndLine: string
  • copyPath.lineNumber.selectionMultiLineFormat: range | list | perLine

GIFs (demos)

Single line copy - Select a single line and copy path with line number:

Single line copy

Copy multi line - Select multiple lines, copied as a range:

Copy multi line

Settings - Configure path style, separator, and multi-line format in settings:

Settings

Multi selection - Select multiple separate lines and copy each with its line number:

Multi selection

Notes

  • If no workspace is open, relative falls back to absolute path.
  • tilde only applies when the path is under your home directory.
  • Unsaved or non-file documents will show a message instead of copying.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft