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

Copy File Path with Range

Chang Wang

|
2 installs
| (0) | Free
Copy file path with range to provide as context to coding assistants
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy File Path with Range

VSCode extension to copy file paths with selection ranges for easy sharing with coding assistants.

Features

  • Copy with line ranges: Select code and copy path with line/column ranges
  • Two modes:
    • Relative path: src/main.py:42-58
    • Absolute path: /home/user/project/src/main.py:42-58
  • Smart formatting:
    • Single line: :42
    • Multiple lines: :42-58
    • With columns: :42:15-58:30
    • Multiple selections: :42-45,:50-52

Usage

  1. Select code in the editor
  2. Right-click and choose:
    • Copy Relative Path with Range - Alt+L (Windows/Linux) or Option+L (Mac)
    • Copy Absolute Path with Range - Alt+Shift+L (Windows/Linux) or Option+Shift+L (Mac)

Installation

Install from the VS Code Marketplace or search for "Copy File Path with Range" in the Extensions view.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft