Skip to content

Latest commit

 

History

History
42 lines (22 loc) · 1.88 KB

README_en.md

File metadata and controls

42 lines (22 loc) · 1.88 KB

Kotlin Code Sorter

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.

1

Features

  • 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.

Install

  • Use IDE built-in plugin market installation:

    • File > Preferences(Settings) > Plugins > Browse repositories... > search "Kotlin code sorter" > Install Plugin
  • Manual:

    • DownloadLatest Release > File >Preferences(Settings) > Plugins > Install plugin from disk...

relaunch IDE.

Use

  1. Default shortcut Ctrl + Alt + K. You can modify it by yourself: 2

  2. Of course ,you can clickCode > Sort kotlin code > fields->initializer->constructors->functions

  3. ClickFile >Settings >Other Settings >Kotlin Code Sorter You can adjust the order you like:

    3

Inspired by Lifecycle Sorter