visual studio code disable auto wrap long line

Kymo Wang picture Kymo Wang · Nov 21, 2017 · Viewed 32.7k times · Source

I use vs code to write python with pylint. When I press ctrl+S(save), the editor wrap a long line into multiple short lines. How to disable the action or configure wrap column count to 120 (default is 80)? I have tried "python.linting.pylintArgs": ["--max-line-length=120"] and "editor.wordWrapColumn": 120, but didn't work.

Answer

Chayapol picture Chayapol · Jan 2, 2018

Check your Python formatting provider.

"python.formatting.provider": "autopep8"

I guess in your case it is not PyLint who keeps wrapping the long lines, but autopep8.Try setting --max-line-length for autopep8 instead.

"python.formatting.autopep8Args": [
    "--max-line-length=200"
]