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

Copy Path with Line

temple-slope

|
127 installs
| (0) | Free
Copy file paths and code snippets in Claude Code-friendly formats
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Path with Line

VS Marketplace Open VSX

Copy file paths and code snippets in Claude Code-friendly formats. Designed so you can paste straight into a Claude Code prompt without editing.

Demo

Install

  • VS Marketplace
  • Open VSX

Features

Four commands, all defaulting to a @-prefixed format that Claude Code resolves as a file reference.

Command Default output Default keybinding (Mac)
Copy Path with Line @src/file.ts:10-25 Shift+Alt+Cmd+L
Copy Path with Line as Markdown path label + fenced code block Shift+Alt+Cmd+M
Copy Relative Path @src/file.ts Shift+Alt+Cmd+C
Copy Full Path @/Users/.../src/file.ts Shift+Alt+Cmd+F

Markdown output example

Pressing Shift+Alt+Cmd+M with lines 15–19 selected produces:

@src/extension.ts:15-19
```typescript
if (selection.start.line === selection.end.line) {
  result = `${relativePath}:${selection.start.line + 1}`;
} else {
  ...
}
```

Paste it into Claude Code and the model gets both the file reference and the exact snippet you're talking about.

Settings

Setting Default Description
copy-path-line.atPrefix true Prepend @ to copied paths. Set false for plain paths.
copy-path-line.rangeSeparator "dash" Range separator. "dash" → 15-19, "colon" → 15:19.
copy-path-line.exitVisualModeAfterCopy true After copying, exit Vim visual mode (calls extension.vim_escape). No effect without VSCodeVim.

To restore the pre-0.1.0 behavior (src/file.ts:10:25):

"copy-path-line.atPrefix": false,
"copy-path-line.rangeSeparator": "colon"

Keybindings

Command Mac shortcut
copy-path-line.copy Shift+Alt+Cmd+L
copy-path-line.copyAsMarkdown Shift+Alt+Cmd+M
copy-path-line.copyRelativePath Shift+Alt+Cmd+C
copy-path-line.copyFullPath Shift+Alt+Cmd+F

All keybindings can be customized in VSCode's keybindings.json. Shift+Alt+Cmd+F is the built-in Format Document shortcut and may need rebinding if you want the full-path command on that key.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft