🇺🇸 Quickly copy file paths and line numbers in a format optimized for AI prompts.
🇨🇳 一键复制文件路径和行号,格式专为 AI 提示优化。
When working with AI coding assistants (Claude, ChatGPT, etc.), you often need to reference specific files with syntax like @path/to/file#L10-25. This plugin makes it a one-click operation — right-click, copy, done.
- Project View — Right-click any file to copy its project-relative path as
@path/to/file.kt - Editor — Right-click with a text selection to copy the path and line range as
@path/to/file.kt#L5-12 - Single line selection copies just
@path/to/file.kt#L5
| Context | Action | Result |
|---|---|---|
| Right-click a file in Project View | Copy relative path | @src/main/Main.kt |
| Select text in editor → right-click | Copy path + line numbers | @src/main/Main.kt#L10-25 |
The copied text is ready to paste directly into your AI prompt.
From JetBrains Marketplace (once published):
Settings/Preferences → Plugins → Marketplace → Search for "copy-ai-reference" → Install
Manually from disk:
Download the latest release and install via Settings/Preferences → Plugins → ⚙️ → Install plugin from disk...
在用 AI 编程助手(Claude、ChatGPT 等)时,经常需要在提示词中引用具体文件,格式如 @path/to/file#L10-25。这个插件让你一键搞定 —— 右键、复制、粘贴。
- 项目视图 — 右键任意文件,复制
@相对路径/文件名.kt格式的引用 - 编辑器 — 选中代码后右键,复制
@相对路径/文件名.kt#L5-12格式的引用(含行号) - 单行选中则仅输出
@相对路径/文件名.kt#L5
| 操作 | 说明 | 结果 |
|---|---|---|
| 在项目视图中右键文件 | 复制相对路径 | @src/main/Main.kt |
| 在编辑器中选中文本后右键 | 复制路径 + 行号 | @src/main/Main.kt#L10-25 |
复制后的内容可直接粘贴到 AI 提示词中使用。
从 JetBrains Marketplace 安装(发布后):
设置 → 插件 → Marketplace → 搜索 "copy-ai-reference" → 安装
手动安装:
下载最新发布包,通过 设置 → 插件 → ⚙️ → 从磁盘安装插件... 安装
./gradlew buildPlugin
# Output: build/distributions/copy-ai-reference-*.zip- IDE: IntelliJ IDEA (2025.2+)
- Platform:
com.intellij.modules.platform
Plugin based on the IntelliJ Platform Plugin Template.