vscode C++ clang-format 적용

2020. 9. 15. 00:45자유

(설정 - 확장 - C/C++ - C_Cpp: Clang_format_fallback Style)

설명대로 Visual Studio, LLVM, Google, Chromium, ... 이 외에도 GNU, Microsoft 등 간단하게 입력해도 키워드에 맞는 format을 지원한다.

 

하나하나 해봤는데 평소에 사용하던 것과 일치하는 포맷이 없어서 조금만 수정해서 사용하기로 했다.

 

 

.clang-format 파일 생성하고 원하는 포맷에 맞게 작성하면 끝이다.

 

작성할 때 참고 : clang.llvm.org/docs/ClangFormatStyleOptions.html

 

Clang-Format Style Options — Clang 12 documentation

Clang-Format Style Options Clang-Format Style Options describes configurable formatting style options supported by LibFormat and ClangFormat. When using clang-format command line utility or clang::format::reformat(...) functions from code, one can either u

clang.llvm.org

 

Ctrl + K + F 키를 눌렀을 때 잘 동작한다.

 

설정에서 Format On Save 항목에 체크하면 파일을 저장할 때마다 알아서 포맷에 맞게 저장해준다.

'자유' 카테고리의 다른 글

SysWOW64와 System32 폴더  (0) 2020.09.22