How to change the width of line wrap from 120 default? #12280
-
I did extension bisect and this is the extension that affects this, with the command "Format Document" on a file. It wraps the line at 120 characters, and I can't find any setting to change that width https://code.visualstudio.com/docs/cpp/customize-default-settings-cpp I tried other standard vscode settings, I also tried with editorconfig file, but this extension does not seem to respect any of these settings. Seems like a very basic requirement, I am surprised nobody raised/discussed/resolved this yet. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Posting here the way I resolved this in case it helps others - add this to the vscode settings: "C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, ColumnLimit: 140, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", and change the number at ColumnLimit Also can add editor rulers to help visually
Another way possible if the above does not work: In vsode settings add this and restart vscode (not sure if you need the first 2 but anyway):
|
Beta Was this translation helpful? Give feedback.
Posting here the way I resolved this in case it helps others - add this to the vscode settings:
"C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, ColumnLimit: 140, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }",
and change the number at ColumnLimit
Also can add editor rulers to help visually
Another way possible if the above does not work:
In vsode settings add this and restart vscode (not sure if you need the first 2 but anyway):