Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
Sep 13, 2018
39 416
The Realigner plugin adds three tools for reformatting code:
  • Join (Ctrl+Shift+Alt+J) - Removes newlines from selected lines, optionally joining them using a "glue" string.
  • Split (Ctrl+Shift+Alt+L)- Replaces arbitrary strings with newlines.*
  • Wrap / Unwrap (Ctrl+Shift+Alt+W) - Adds or removes a prefix- and postfix- string to a selection, the current line or each of multiple selected lines. Frequently used wraps can be stored as quick-wrap buttons, hint: quick-wrap buttons can be selected via cursor up/down keys as well.

Mac Users: On Macs, the keyboard shortcuts are J, L or W together with Shift+Alt+Cmd

*Splitting with an empty delimiter and w/o selection inserts a newline at the soft-wrap boundary.

Realigner is helpful e.g. for:
  • Reformatting lines into comma-separated lists
  • Converting lists into lines
  • Breaking up long URLs for easier analysis
  • Quickly commenting-out multiple lines of code even if that particular language is not supported
  • Quickly un-commenting lines of code even if that particular language is not supported
  • Commenting-out / un-commenting using keyboards with layouts not compliant to the keyboard shortcuts for the similar in-built function
  • Reformatting long lines to wrap at the soft-wrap boundary (120 chars)

Please note: This plugin is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Recent change notes

  • 1.6.0
    • Updated to JDK 1.8 / IntelliJ Idea IU-182.4323.46 / IDEs since build 13.7
    • Bugfix: Fixed exceptions thrown due to AWT threading within write actions
    • Changed split action keystroke to CTRL+ALT+S
    • Cleanup/Modernized: lambdas instead of anonymous callables, early returns, ternary returns, less redundant code
  • 1.5.1 Changed join: parts are now trimmed from whitespace before joining
  • 1.5.0
    • Improved keyboard accelerator: quick-wraps can now be applied w/ ENTER key
    • Improved UI: globalized mode options (instead of being quick-wrap exclusive)
    • Improved UI: removed explicit un/wrap buttons, renamed "Autodetect" to "Toggle"

...Read full changelog on github