vs code 에서 word wrap 줄 바꿈 길이 조정하기
vs code에서 shift + alt + f를 누르면 코드를 예쁘게 자동 줄바꿈 (line break) 해줍니다.
그리고 어느 코드 길이만큼을 줄바꿈 기준으로 할 지를 정할 수 있습니다.
dart언어의 경우에는 settings 에 가셔서 dart.lineLength 라고 검색하시면 기본값으로 80이 되어있습니다. 이걸 바꾸셔야 자동줄바꿈 기준이 바뀝니다.
제가 설정한 settings.json입니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"workbench.colorTheme": "Default Dark Modern",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"editor.fontSize": 16,
"files.exclude": {
"**/*.freezed.dart": true,
"**/*.g.dart": true
},
"github.copilot.editor.enableAutoCompletions": true,
"dart.debugExternalPackageLibraries": true,
"dart.debugSdkLibraries": false,
"editor.tabSize": 2,
"editor.indentSize": "tabSize",
"emmet.preferences": {
},
"editor.formatOnSave":false,
"editor.wordWrapColumn": 160,
"editor.wordWrap": "wordWrapColumn",
"diffEditor.wordWrap": "inherit",
"dart.lineLength": 160,
}
다음 요소를 추가했습니다.
1
2
3
4
5
"editor.formatOnSave":false,
"editor.wordWrapColumn": 160,
"editor.wordWrap": "wordWrapColumn",
"diffEditor.wordWrap": "inherit",
"dart.lineLength": 160,
이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.