Skip to content
\n

Another way possible if the above does not work:

\n

In vsode settings add this and restart vscode (not sure if you need the first 2 but anyway):

\n
\"C_Cpp.clang_format_style\": \"Visual Studio\",\n\"C_Cpp.clang_format_fallbackStyle\": \"Visual Studio\",\n\"editor.wordWrap\": \"wordWrapColumn\",\n\"editor.wordWrapColumn\": 160,\n
","upvoteCount":1,"url":"https://github.com/microsoft/vscode-cpptools/discussions/12280#discussioncomment-9312691"}}}

How to change the width of line wrap from 120 default? #12280

Answered by manos-msdn
manos-msdn asked this question in Q&A
Discussion options

You must be logged in to vote

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

"editor.rulers": [
    140,
    160
  ],

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):

"C_Cpp.clang_format_style": "Visual Studio…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by manos-msdn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants