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
-
🅰️ 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.
- Install the plugin and restart IntelliJ IDEA.
- Open any text or JSON file in the editor.
- Select the lines you want to sort (or leave nothing selected to sort the whole file).
- Right-click in the editor and choose Refactor → Sort Lines....
- 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
-
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