Copy selected code with its file path and line range in one keystroke, or click.
src/components/Header.tsx#L13-17
const Brand = ({ name }: { name: string }) => (
<a href="/" className="text-lg font-semibold tracking-tight">
{name}
</a>
);- Copy location and code together. No manual path lookup or line-number cleanup.
- Keep the selected code unchanged. The extension adds only the location header and separator.
- Use workspace-relative paths. Paths stay compact and portable between machines.
- Works with multiple selections. Each non-empty selection gets its own location header.
Developed & maintained by Serbyte Development · GitHub
- Highlight code in VS Code or Cursor.
- Right-click the editor.
- Run
Copy w/ Location.
Shortcut:
- macOS:
Cmd+Option+C - Windows/Linux:
Ctrl+Alt+C
Single-line selections use #L25. Multi-line selections use #L25-30.
Copy w/ Location supports desktop VS Code 1.85+ and Cursor using standard VS Code editor and clipboard APIs. It does not require workspace trust and has no runtime dependencies.
npm install
npm test
npm run check
npm run packageFor bugs or focused feature requests, see SUPPORT.md.
MIT.

