Reformat Code

Tell PyCharm to clean up indentation and other code style in your file.

Perhaps you copy and pasted some code with a different line length than your other code. Or you join a project where the other have sinned against all the gods with their heretical indentation spacing. Tabs?!

PyCharm makes it easy to set code styles in wildly flexible ways (project vs. IDE, EditorConfig files, inline markers to suppress, etc.) But PyCharm makes it even easier to apply those code styles with the Reformat Code ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux) action.

This action has an easy shortcut and can be applied to an entire file, a selection, or across many files in the project. With PyCharm Professional, you can also use it outside of Python, in JavaScript, CSS, etc.


Related Resources

See VCS Changed Lines In Gutter
Quickly spot which parts of your file have changed since the last commit.
Split Screen Without Tabs
Get your code and tests side-by-side without resorting to tabs.
Run From Keyboard
Use the keyboard to select and run a run configuration.