Copies a clean @relative/path#Lstart-end reference of the active file and selection to the clipboard, and sends it to the active integrated terminal / Claude Code CLI.
Download from the official OpenVSX registry: https://open-vsx.org/extension/lucianodlf/gplnr
curl -L -o gplnr.vsix "https://open-vsx.org/api/lucianodlf/gplnr/0.0.1/file/lucianodlf.gplnr-0.0.1.vsix"
code --install-extension ./gplnr.vsix
# with a specific profile
code --profile "<your-profile>" --install-extension gplnr.vsix --forceAfter installation, run the command palette and select "Developer: Reload Window" to activate the extension.
Keybinding: ctrl+alt+k (editor must have focus).
Output examples:
- No selection:
@src/app.js - Single-line selection:
@src/app.js#L12 - Multi-line selection:
@src/app.js#L12-40
If an integrated terminal is active, the text is pasted into it. Otherwise, only the clipboard is updated — no new terminal is created.
gplnr.useAbsolutePath(boolean, defaultfalse): use the absolute path instead of the workspace-relative one.
If you have the official anthropic.claude-code extension (Claude Code CLI for VS Code) installed, it registers its own command on ctrl+alt+k:
command: claude-code.insertAtMentioned
key (linux/win): ctrl+alt+K
when: editorTextFocus
Same shortcut, same when clause as gplnr.copyReference. claude-code.insertAtMentioned wins: pressing ctrl+alt+k opens the Claude Code terminal and inserts an @mention there instead of running gplnr, and nothing is copied to the clipboard.
To free up ctrl+alt+k for gplnr only, add this to your user keybindings.json (Preferences: Open Keyboard Shortcuts (JSON)):
{
"key": "ctrl+alt+k",
"command": "-claude-code.insertAtMentioned",
"when": "editorTextFocus"
}The - prefix on command disables that specific binding without uninstalling or reconfiguring the extension. Alternative: change the key for gplnr.copyReference in package.json to a free combination.
buildReference (the only branching logic: #L suffix, useAbsolutePath, separator normalization) has unit tests via node --test — no new dependencies, no VS Code startup. test/vscode-stub.js intercepts require('vscode') with a minimal stub (workspace.getConfiguration, workspace.asRelativePath) before loading extension.js.
npm testnpm run package && code --profile "<your-profile>" --install-extension gplnr-0.0.1.vsix --forceIf you use VS Code profiles (Profiles: Create Profile / profile picker bottom-left), --profile is required: without it, code --install-extension installs the files but registers them under the default profile, not the one you have open — the extension ends up on disk but invisible in the editor. Find the active profile name via Profiles: Show Profile Contents in the command palette, or by checking userDataProfiles in ~/.config/Code/User/globalStorage/storage.json.