Download and install either IntelliJ IDEA Ultimate or IntelliJ IDEA Community Edition.
git clone git://git.jetbrains.org/idea/community.git idea
Configure a common JDK and an IntelliJ Platform SDK. For the IntelliJ Platform SDK you may need to specify the directory containing the installed version IntelliJ IDEA. By default it should offer the directory of the currently running version of IntelliJ IDEA.
To attach the Community Edition source files to the SDK, open the Sourcepath tab in the SDK configuration dialog, press the Add button and select the directory with the Community Edition source checkout. IntelliJ IDEA will scan the directory for roots and offer the list of roots to add, with everything checked by default. Accept the list of roots by pressing OK.
Create an IntelliJ Platform Plugin project and specify IntelliJ Platform SDK.