A simple plugin for sorting kotlin code.
A small plugin that can sort Kotlin code. Recently in the daily development, I found that the code arrangement of Kotlin is not as good as that of Java. In IDEA or AndroidStudio, Java fields are usually in the front, and methods are in the back. It looks better than others. In Kotlin, however, the overridden variables and functions are arranged according to the order in which they are overwritten, with the last written first and the last written first. And the fields and functions are interspersed, really obsessive compulsive disorder. With this small plug-in, gently press the instant row, flattered.
- Support for sorting code by the default order of fields -> initializer blocks -> constructors -> methods -> inner classes.
- Since 1.2, you can customize the sort order in the Settings panel.
-
Use IDE built-in plugin market installation:
- File > Preferences(Settings) > Plugins > Browse repositories... > search "Kotlin code sorter" > Install Plugin
-
Manual:
- Download
Latest Release
> File >Preferences(Settings) > Plugins > Install plugin from disk...
- Download
relaunch IDE.
-
Default shortcut Ctrl + Alt + K. You can modify it by yourself:
-
Of course ,you can clickCode > Sort kotlin code > fields->initializer->constructors->functions
-
ClickFile >Settings >Other Settings >Kotlin Code Sorter You can adjust the order you like:
Inspired by Lifecycle Sorter