Skip to content

anton-erofeev/line-sorter-intellij-plugin

Repository files navigation

Lines Sorter Pro IntelliJ IDEA plugin

Build Version Downloads

Description

Lines Sorter Pro is a powerful and easy-to-use plugin for IntelliJ IDEA that helps you instantly organize your text, code, or configuration files. Whether you need to sort lines alphabetically, by length, shuffle them, or even recursively sort keys in complex JSON files — this tool does it in just a couple of clicks.

  • Supports plain text, code, and JSON files
  • Works with selected lines or the entire file
  • Recursively sorts nested JSON objects
  • Integrates seamlessly into the editor’s right-click Refactor menu

🚀 Key Features

  • 🅰️ Alphabetical Sorting
    Sort lines alphabetically (A-Z or Z-A).

  • 🔢 Sorting by Line Length
    Sort lines by their length (shortest to longest or vice versa).

  • 🔀 Shuffle Lines
    Randomly shuffle selected lines or the entire file.

  • 📄 Flexible Scope
    Works with selected text or the whole file if nothing is selected.

  • 🗂️ JSON File Sorting

    • Sort JSON object keys alphabetically, by value length, or shuffle.
    • Supports recursive sorting for nested JSON objects.
  • Easy Access
    All features are available via the right-click Refactor menu in the editor.

Ideal for: Developers working with configuration files, property lists, text data, or any files where organized, readable line order improves workflow and readability.

How to Use

  1. Install the plugin and restart IntelliJ IDEA.
  2. Open any text or JSON file in the editor.
  3. Select the lines you want to sort (or leave nothing selected to sort the whole file).
  4. Right-click in the editor and choose RefactorSort Lines....
  5. Pick the desired sorting option from the menu:
    • Sort Alphabetically (A-Z or Z-A)
    • Sort by Line Length (ascending/descending)
    • Shuffle Lines
    • Sort JSON keys (alphabetically, by value length, or shuffle)
Example: Sorting JSON

Before:

{
  "z": 1,
  "a": {
    "d": 4,
    "b": 2,
    "c": {
      "y": 25,
      "x": 24
    }
  },
  "b": 3
}

After (alphabetical):

{
  "a": {
    "b": 2,
    "c": {
      "x": 24,
      "y": 25
    },
    "d": 4
  },
  "b": 3,
  "z": 1
}
Example: Sorting plain text lines

Before:

banana
apple
carrot

After (alphabetical):

apple
banana
carrot

Installation

  • Using the IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "line-sorter-intellij-plugin" > Install

  • Using JetBrains Marketplace:

    Go to JetBrains Marketplace and install it by clicking the Install to ... button in case your IDE is running.

    You can also download the latest release from JetBrains Marketplace and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...


Author: anton-erofeev

About

Line Sorter is an IntelliJ IDEA plugin for quick line sorting within files. It lets you alphabetize either the entire file or just the selected lines, making it ideal for organizing configuration files, lists, and other text data with ease. Access it via the Refactor menu or by right-clicking in the editor.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages