How do I set the maximum line length in PyCharm?
I am using PyCharm on Windows and want to change the settings to limit the maximum line length to 79
characters, as opposed to the default limit of 120
characters.
Where can I change the maximum amount of characters per line in PyCharm?
Here is screenshot of my Pycharm. Required settings is in following path: File -> Settings -> Editor -> Code Style -> General: Right margin (columns)
For PyCharm 2018.1 on Mac:
Preferences (⌘+,), then Editor -> Code Style
:
For PyCharm 2018.3 on Windows:
File -> Settings (Ctrl+Alt+S), then Editor -> Code Style
:
To follow PEP-8 set Hard wrap at
to 80.
For PyCharm 4
File >> Settings >> Editor >> Code Style: Right margin (columns)
suggestion: Take a look at other options in that tab, they're very helpful
You can even set a separate right margin for HTML. Under the specified path:
File >> Settings >> Editor >> Code Style >> HTML >> Other Tab >> Right margin (columns)
This is very useful because generally HTML and JS may be usually long in one line than Python. :)