Skip to content

Commit c5b68b1

Browse files
Added image
1 parent 32dc81a commit c5b68b1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

content/software/ide-v2/tutorials/ide-v2-customize-auto-formatter/content.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: 'Customizing the Auto Formatter'
2+
title: 'Customizing the Auto Formatter Feature'
33
difficulty: easy
4-
description: 'Learn how '
4+
description: 'Learn how to configure the auto formatter feature'
55
tags:
66
- Auto Formatter
77
- Tools
8-
author: 'Benjamin Dannegård'
8+
author: 'Benjamin Dannegård, Per Tillisch'
99
---
1010

11-
Pressing CTRL + T on Windows or CMD + T on MacOS when writing a sketch in the Arduino IDE 2.0 will automatically format the sketch. And it is possible to change the behaviour of this command. In this article we will go through how you can change the behaviour of this command.
11+
Pressing CTRL + T on Windows or CMD + T on MacOS when writing a sketch in the Arduino IDE 2.0 will automatically format the sketch. It is possible to change the behaviour of this command. In this article we will go through how you can change the behaviour of this command.
1212

1313
You can easily download the editor from the [Arduino Software page](https://www.arduino.cc/en/software#experimental-software).
1414

@@ -18,9 +18,9 @@ You can also follow the [downloading and installing the Arduino IDE 2.0](/en/Tut
1818

1919
- Arduino IDE 2.0 installed.
2020

21-
## Setting Custom Configuration
21+
## Setting the Custom Configuration
2222

23-
It is possible to define your own custom configuration in two different ways. The custom configuration of the auto formatter can be set on a global level to cover all sketches opened in the editor, or you can set the configuration to be specific to a sketch.
23+
It is possible to define your own custom configuration of the auto formatter feature in two different ways. The custom configuration of the auto formatter can be set on a global level to cover all sketches opened in the editor, or you can set the configuration to be specific to a sketch.
2424

2525
### Global scope
2626
If you add a `.clang-format` configuration file to either of the following locations, the Arduino IDE 2.0 will always use it instead of the Arduino default configuration.
@@ -55,10 +55,14 @@ Or
5555
### Sketch scope
5656
If you add a `.clang-format` configuration file to the root of a sketch, the Arduino IDE will use that configuration when formatting that sketch. This file has precedence over a global formatter configuration file.
5757

58+
![.clang-format file at the root of a sketch](assets/format-file-at-root.png)
59+
5860
## Default Formatting File
5961

6062
Here you can find the default formatting file used in the Arduino IDE 2.0. If you wish to customize how your auto formatting acts in the IDE then starting with this file is a good idea.
6163

64+
***Please note that the custom configuration file completely overrides the Arduino default configuration, rather than merging with it. Any configuration option you don't set in your custom file will be set to the ClangFormat default value.***
65+
6266
```cpp
6367
---
6468
Language: Cpp
@@ -208,7 +212,7 @@ WhitespaceSensitiveMacros: []
208212
209213
## Conclusion
210214
211-
In this tutorial we went through how to customize the behaviour of the CTRL + T / CMD + T auto formatter command in the Arduino IDE 2.0. This article also shows the different scopes for the auto formatter configuration.
215+
In this tutorial we went through how to customize the behavior of the `CTRL + T / CMD + T` auto formatter command in the Arduino IDE 2.0. This article also shows the different scopes that are available for the auto formatter configuration.
212216
213217
### More Tutorials
214218

0 commit comments

Comments
 (0)