I often need to use a text editor while writing code to paste random notes but especially JSON responses, where I format them using a plugin (for Sublime).
I recently heard about the 'scratch file' feature in IntelliJ / Android Studio which does exactly what I need it to - except I can't make it format JSON I paste in nicely.
How can I make Android Studio format JSON in a scratch buffer file?
I highlight the code and run Command Option L (a short-cut for the Code->Reformat Code menu).
Note that this only works if the code is well-formed JSON (clear any red squiggles).