Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>LineClipNew to Visual Studio Code? Get it now.
LineClip

LineClip

joyfulapps

|
1 install
| (0) | Free
| Sponsor
Quickly copy file path, line number, and line content to clipboard with a single click.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LineClip

Quickly copy file path, line number, and line content to clipboard with a single click.

LineClip is a VS Code extension that helps you quickly copy code references for sharing, documentation, or issue reporting. It's a port of the LineClip JetBrains plugin with full feature parity.

Features

  • 🎯 Right-click convenience: Access from the editor context menu
  • 📋 Smart formatting: Copies in format: relative/path/to/file.ext:42 line_content (or absolute path via alternate command)
  • ✨ Clean output: Automatically trims leading and trailing whitespace
  • 💬 Visual feedback: Status bar message shows preview of copied content
  • ⌨️ Keyboard shortcut support: Configure your own shortcut (no default binding)
  • 🗂️ Multi-root aware: Relative paths are resolved against the workspace folder that owns the file

Installation

Option 1: VS Code Marketplace

  1. Open VS Code
  2. Go to the Extensions view
  3. Search for "LineClip"
  4. Click Install

Option 2: Build from Source

  1. Clone the repository, then from the project root:

    npm install
    npm run compile
    npx @vscode/vsce package
    

    The extension package will be created as lineclip-<version>.vsix

  2. Install in VS Code

    • Open the Extensions view
    • Click the ... menu → Install from VSIX...
    • Select the generated .vsix file

Usage

Method 1: Context Menu in Editor

  1. Right-click anywhere in the code editor
  2. Select "Copy Line Info" or "Copy Line Info (Abs Path)" from the context menu
  3. Paste anywhere to get the file path, line number, and content

Method 2: Keyboard Shortcut (Optional)

  1. Open Preferences → Keyboard Shortcuts
  2. Search for "Copy Line Info" or "Copy Line Info (Abs Path)"
  3. Click the + icon and set your preferred shortcut

Output Format

Normal Lines

src/extension.ts:42  export function activate(context: vscode.ExtensionContext): void {

Empty Lines

src/extension.ts:15

Edge Cases

Scenario Behavior
Empty line Copies path and line number only (no trailing spaces)
Very long line (500+ chars) Copies full line without truncation
Multi-root workspace Relative path is resolved against the workspace folder that owns the file
No active editor Command is a no-op

Compatibility

  • Platform: VS Code 1.85.0 or later
  • Language: TypeScript

Development

Prerequisites

  • Node.js 22 or later (required by @vscode/test-electron 3.x)

Building

npm install
npm run compile     # type-check + esbuild bundle
npm test             # run tests via @vscode/test-electron + Mocha
npx @vscode/vsce package   # produce a .vsix

Publishing a new release (Marketplace publisher account, tokens) is documented separately in PUBLISHING.md.

Project Structure

lineclip/
├── src/
│   ├── extension.ts
│   └── lineInfoFormatter.ts
├── test/
│   ├── runTest.ts
│   ├── suite/
│   │   ├── index.ts
│   │   ├── lineInfoFormatter.test.ts
│   │   └── extension.test.ts
│   └── fixtures/workspace/sample.txt
├── images/
│   └── icon.png
├── package.json
├── esbuild.js
├── tsconfig.json
├── CHANGELOG.md
├── PUBLISHING.md
└── LICENSE

License

MIT License

Author

Created by JoyApps

Changelog

See CHANGELOG.md for the full version history.

Support

If you encounter any issues or have suggestions, please reach out at joyappsfeedback@hotmail.com.

Support LineClip

LineClip is free and ad-free. If you try opencode Go — a low-cost AI coding plan — through our link, both of us get a $5 usage credit when you subscribe.

Run LineClip: Support LineClip from the Command Palette to copy the link, or hide the section via the lineclip.hideSupportSection setting.

We earn a $5 credit if you subscribe via our link.

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