A lightweight IntelliJ Platform plugin that helps you quickly copy file paths with line numbers from your code selection.
- Copy with line numbers - Get the file path along with the exact line range of your selection
- Relative or absolute paths - Choose between project-relative paths or full file system paths
- Context menu integration - Right-click in the editor for quick access
- Keyboard shortcuts - Customize your workflow with default shortcuts
- Cross-platform - Works on Windows, macOS, and Linux
Perfect for:
- Code reviews - Share precise code locations with your team
- Bug reports - Reference exact lines when filing issues
- Documentation - Quickly link to specific code sections
- Team collaboration - Communicate code locations in chat/email
- Go to
File→Settings→Plugins(Android Studio:File→Settings→Plugins) - Search for "Copy Selection Path"
- Click
Install
- Download the latest release
- Go to
File→Settings→Plugins - Click the gear icon →
Install Plugin from Disk... - Select the downloaded
.zipfile - Restart the IDE
- Select text in the editor
- Right-click to open the context menu
- Choose one of the options:
- Copy Selection with Path & Line Numbers - copies relative path from project root
- Copy Selection with Full Path & Line Numbers - copies absolute file system path
| Selection Type | Output Example |
|---|---|
| Single line | src/main/kotlin/App.kt line:42 |
| Multiple lines | src/main/kotlin/App.kt line:250-253 |
| Action | Windows/Linux | macOS |
|---|---|---|
| Relative path | Ctrl+Shift+Alt+C |
Cmd+Shift+Alt+C |
| Absolute path | Ctrl+Shift+Alt+Shift+C |
Cmd+Shift+Alt+Shift+C |
You can customize these shortcuts in
Settings→Keymap
This plugin works with all IntelliJ Platform-based IDEs including:
- IntelliJ IDEA
- Android Studio
- PyCharm
- WebStorm
- PhpStorm
- CLion
- GoLand
- Rider
- RubyMine
- Build 232.0 or higher (IntelliJ Platform 2023.2+)
- Build 253.0 or lower (supports up to 2024.2 releases)
# Clone the repository
git clone https://github.com/maoruibin/CopySelectLine.git
cd CopySelectLine
# Build the plugin
./gradlew buildPlugin
# Run in development mode
./gradlew runIdeContributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.
Made with ❤️ by Gudong
- VS Code Extension - The original VS Code version