当前位置:网站首页>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 .
边栏推荐
- In some cases, error: (XX, XX) failed to resolve: XXXXXX.
- Verilog daily question (VL2 asynchronous reset Series T trigger - Niuke network)
- Selection and application of capacitor in high speed circuit -- detailed explanation
- Visual studio 2012/2015 releases web applications together with.Cs source code
- Shell脚本之AWK
- [CDH] configure CDH components through clouderamanager and collect JMX information with Prometheus monitoring
- C#基础面试题(附答案)
- [Presto] details of the new version upgrade of Presto
- 区分ES6的export与Nodejs的module.exports的区别
- Verilog 每日一题(VL6 数据串转并电路)
猜你喜欢

Sed of shell programming

Firewalld防护墙

LNMP源码编译安装

在PDF中插入文本水印

Verilog 每日一题(VL29 单端口RAM)

Verilog daily question (vl4 shift operation and multiplication)

The practice of the beego framework for goweb development: Section V project construction and user registration

数据库优化——深入理解Mysql索引底层数据结构与算法

Wild pointer recurrence

Zero foundation uses unity3d to develop AR applications and download 3D models remotely
随机推荐
Sed of shell programming
Verilog daily question (vl6 data series to parallel circuit)
掌握JVM面试专题和答案Offer拿到手软(附学习路线图)
Blue Bridge Cup embedded competition resources and skills
关于标准IO缓冲区的问题
MySQL的触发器
Batch download files
Easy to use vscode plug-in memo
Firewalld防护墙
Mysql database addition, deletion, modification and query (detailed explanation of basic operation commands)
阿里P8架构师谈:成为架构师必须学好的七大知识点(含面试题)
AMQP协议详解
WPF command button transparent style
Verilog 每日一题(VL2 异步复位的串联T触发器--牛客网)
数据库优化——深入理解Mysql索引底层数据结构与算法
Verilog 每日一题 (VL27 可置位计数器)
高速电路中电阻的选择
[Presto] common commands of Presto
漫谈测试平台—平台建设思路(上)
Redis源码剖析,狠狠地拿捏了,赶紧码住