Copy Lines for VS Code

A lightweight extension designed to help you quickly copy code context in Github permalink style for AI chats (like ChatGPT, Claude, or Cursor).
Features
When you select any text in the editor, two CodeLens buttons appear instantly above your selection:
- $(copy) Copy Refer
- Copies the file path and line numbers.
- Example:
src/utils/helper.ts:10-20
- $(copy) Copy Block
Configuration
This extension provides the following setting:
copy-lines.useAbsolutePath (Default: false)
- false: Uses path relative to the workspace root (e.g.,
src/main.ts).
- true: Uses the full absolute path (e.g.,
/Users/name/project/src/main.ts).
Usage
- Open any file.
- Select lines of code.
- Click the Copy Refer or Copy Block button appearing above the selection.
- Paste into your AI tool.
Enjoy efficient coding!
| |