当前位置:网站首页>clang format
clang format
2022-07-28 17:33:00 【maosql】
clang format introduction
I found some information myself , It doesn't feel complete , Piecemeal to sum up for yourself , So that future students can quickly start an article .
clang format Sure linux Download is also OK vscode download .
One :VsCode download

Open Settings search ( format on save ), After checking the check mark, it will be automatically formatted after each save 
If Clang_format_style by file It will automatically look for a formatted file in the parent directory ( .clang-format ), This file can configure its own format .
If you don't find one named ( .clang-format ) The file of , It will be formatted in a default style .
Two :ubuntu download
sudo apt-get install clang-format
3、 ... and : Use (common)
This paper mainly introduces .clang-foramt file , Configure the format yourself , If it is a fixed format , Then this plug-in is meaningless .
If not, no ( .clang-format ) file , You can manually generate , But you don't have to configure them all by yourself , You can export one at will LLVM Format or Google Format , Modify it to the format you need , Of course touch Create all by yourself .
Format :( if necessary tab Completion is about ubuntu Upload and download )
clang-format -style= Optional format name -dump-config > .clang-format
# It's best to write the preset formats for the optional formats, which ones are closest to the format you want . For example, I want to approach LLVM google C++ style Of . I'll write -style=google
example :
clang-format -style=llvm -dump-config > .clang-format
.clang-format Files can be placed in the project root directory , More importantly /home Catalog . Because you are looking up for the file you are currently editing , Generally, many of them are placed in the root directory of the current project .
Configure the content :
Example of usage:
BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: true
AfterStruct: false
SplitEmptyFunction: false
afterFunction: true
Find the exported format , Change the format to the above , The code format is as follows .
边栏推荐
- 【CDH】通过 ClouderaManager 配置CDH组件用 prometheus 监控采集JMX信息
- Batch download files
- MySQL implements sorting according to custom (specified order)
- Verilog daily question (vl28 plus and minus counter)
- [kibana] problem sorting kibana 7.x no indices match pattern "APM-*“
- 循环中使用switch在执行条件后使用break和continue的区别
- Introduction to vscade interface
- Mysql database development specification
- Net framework
- 渗透测试大杀器kali安装配置
猜你喜欢

mysql实现按照自定义(指定顺序)排序

Sed of shell programming

wpf命令按钮透明样式

Verilog daily question (vl26 simple stopwatch)

Verilog 每日一题 (VL24 多bit MUX同步器 跨时域输出)

面试官:算法刷题实录.pdf我居然答不上来

Vscode plug-in automatically adds comments

Basic principle of asynchronous FIFO (simple implementation based on Verilog)

线性代数及矩阵论(九)

Blue Bridge Cup embedded competition resources and skills
随机推荐
Flat data to tree
C语言实现扫雷小游戏
Uparse rich text style of uni app
Use Alibaba cloud's free SSL certificate
Valarray Library Learning
Use of influxdb2
Verilog 每日一题 (VL27 可置位计数器)
Easy to use vscode plug-in memo
Vscode uses eslint prettier to format code automatically
influxdb2的使用
Encountered.Sqlite file processing during Android Development
Connection design and test platform -- Summary of SystemVerilog interface knowledge points
Verilog daily question (vl29 single port RAM)
MySQL implements sorting according to custom (specified order)
【sqoop】sqoop1.4.7 安装集成CDH5.13
C # traversal set
QR code generation of wechat applet with parameters
线性代数及矩阵论(七)
部分情况下Error:(xx, xx) Failed to resolve: xxxxxx解决。
渗透测试大杀器kali安装配置