Skip to content

maoruibin/CopySelectLine

Repository files navigation

Copy Selection Path

<script src="https://plugins.jetbrains.com/assets/scripts/mp-widget.js"></script> <script> MarketplaceWidget.setupMarketplaceWidget('card', 29954, "#plugin-card"); </script>

JetBrains Plugin Version License

A lightweight IntelliJ Platform plugin that helps you quickly copy file paths with line numbers from your code selection.

Features

  • 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

Use Cases

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

Installation

From JetBrains Marketplace

  1. Go to FileSettingsPlugins (Android Studio: FileSettingsPlugins)
  2. Search for "Copy Selection Path"
  3. Click Install

From Disk

  1. Download the latest release
  2. Go to FileSettingsPlugins
  3. Click the gear icon → Install Plugin from Disk...
  4. Select the downloaded .zip file
  5. Restart the IDE

Usage

  1. Select text in the editor
  2. Right-click to open the context menu
  3. 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

Output Format

Selection Type Output Example
Single line src/main/kotlin/App.kt line:42
Multiple lines src/main/kotlin/App.kt line:250-253

Default Keyboard Shortcuts

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 SettingsKeymap

Compatible IDEs

This plugin works with all IntelliJ Platform-based IDEs including:

  • IntelliJ IDEA
  • Android Studio
  • PyCharm
  • WebStorm
  • PhpStorm
  • CLion
  • GoLand
  • Rider
  • RubyMine

Requirements

  • Build 232.0 or higher (IntelliJ Platform 2023.2+)
  • Build 253.0 or lower (supports up to 2024.2 releases)

Development

# Clone the repository
git clone https://github.com/maoruibin/CopySelectLine.git
cd CopySelectLine

# Build the plugin
./gradlew buildPlugin

# Run in development mode
./gradlew runIde

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

Author

Made with ❤️ by Gudong

Similar Plugins


JetBrains

About

CopySelectLine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages