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?
The dialog appears when you press Ctrl+Alt+Shift+L in the editor of the current file. If you choose Code | Reformat Code from the main menu or press Ctrl+Alt+L , PyCharm tries to reformat the source code of the specified scope automatically.
Copy selected text to the Clipboard. Cut to the Clipboard. Paste from the Clipboard. Move (drag) or copy ( Ctrl + drag) a file or directory from the file manager to a directory in the Project tool window.
Reformat a file Either open your file in the editor and press Ctrl+Alt+Shift+L or in the Project tool window, right-click the file and select Reformat Code.
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.
Short cut for auto formatting: ctrl + alt + L
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With