A VS Code extension that copies file references in @mention format to your clipboard. Perfect for referencing code in chat, documentation, or code reviews.
Features
Copy file references with a single keyboard shortcut:
File only: @campaign/apply.py
Single line: @campaign/apply.py#L12
Line range: @campaign/apply.py#L12-43
Usage
Open any file in VS Code
Optionally select one or more lines
Press Cmd+Option+K (Mac) or Ctrl+Alt+K (Windows/Linux)
The @mention is copied to your clipboard
Examples
Selection
Result
No selection
@src/utils/helper.ts
Line 5 selected
@src/utils/helper.ts#L5
Lines 10-20 selected
@src/utils/helper.ts#L10-20
Installation
From VSIX
Download the .vsix file
Open VS Code
Press Cmd+Shift+P / Ctrl+Shift+P
Run "Extensions: Install from VSIX..."
Select the downloaded file
From Source
git clone https://github.com/hail-kang/vscode-extension-at-mention-clipboard.git
cd vscode-extension-at-mention-clipboard
npm install
npm run build
npm run package
Configuration
Setting
Default
Description
at-mention-clipboard.useRelativePath
true
Use relative path from workspace root
at-mention-clipboard.prefix
@
Prefix character for the mention
at-mention-clipboard.showNotification
true
Show notification when copied
Keyboard Shortcuts
Command
Mac
Windows/Linux
Copy File Reference
Cmd+Option+K
Ctrl+Alt+K
You can customize the keyboard shortcut in VS Code's Keyboard Shortcuts settings.
Commands
At Mention Clipboard: Copy File Reference as @mention - Copy the current file reference to clipboard
Development
Prerequisites
Node.js 18+
npm
Setup
npm install
Build
npm run build
Watch Mode
npm run watch
Run Tests
npm test
Lint
npm run lint
npm run lint:fix
Package
npm run package
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.