Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy File Line RangeNew to Visual Studio Code? Get it now.
Copy File Line Range

Copy File Line Range

武昌张志明

|
2 installs
| (1) | Free
Copy current file relative path with selected line range, e.g. src/App.vue#L10-L20.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy File Line Range

Copy the current file relative path with the selected line range.

Example output:

src/views/user/index.vue#L120-L156

Usage

  1. Select code in VS Code.
  2. Press:
    • macOS: Cmd + Shift + L
    • Windows/Linux: Ctrl + Shift + L
  3. Paste the copied result into Codex / Cursor / Claude Code.

You can also run the command from Command Palette:

Copy File Line Range
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft