Code Style
The IDEA has amazing code style functionality that allows auto-code formatting.
The plugin provides the same functionality and default configuration for Q language.
Just go to File -> Settings -> Editor -> Code Style -> KDB+ Q:
Please go through the settings yourself as it’s better if you just try to change them. You don’t have to apply and try each time as the IDEA provides an ability to see result online.