How to make jetbrains pycharm auto format code on paste

pycharm, webstorm

Solution

Edit to keep up to date:

The option `Settings | Editor | General | Smart Keys | Smart indent pasted lines` will be of interest (Pycharm 2016.3).

Things are always evolving, as a general (and faster) practice, I would recommend to start typing `smart indent` as soon as the settings window appear. Menus will narrow down to help find where the option sits.

Or even more fancy, `Ctrl + Shift + A` directly from the editor (search everywhere) can bring you to it.

Problem

When I used webstorm and I pasted a bit of code from somewhere else it would do the formatting for me. But with pycharm 3, it is not happening anymore and I have to manually indent the code etc. I want to get that feature back. Is there a way to do that?

Original source