You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/software/ide-v2/tutorials/ide-v2-customize-auto-formatter/content.md
+11-7Lines changed: 11 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
title: 'Customizing the Auto Formatter'
2
+
title: 'Customizing the Auto Formatter Feature'
3
3
difficulty: easy
4
-
description: 'Learn how '
4
+
description: 'Learn how to configure the auto formatter feature'
5
5
tags:
6
6
- Auto Formatter
7
7
- Tools
8
-
author: 'Benjamin Dannegård'
8
+
author: 'Benjamin Dannegård, Per Tillisch'
9
9
---
10
10
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.
12
12
13
13
You can easily download the editor from the [Arduino Software page](https://www.arduino.cc/en/software#experimental-software).
14
14
@@ -18,9 +18,9 @@ You can also follow the [downloading and installing the Arduino IDE 2.0](/en/Tut
18
18
19
19
- Arduino IDE 2.0 installed.
20
20
21
-
## Setting Custom Configuration
21
+
## Setting the Custom Configuration
22
22
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.
24
24
25
25
### Global scope
26
26
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
55
55
### Sketch scope
56
56
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.
57
57
58
+

59
+
58
60
## Default Formatting File
59
61
60
62
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.
61
63
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
+
62
66
```cpp
63
67
---
64
68
Language: Cpp
@@ -208,7 +212,7 @@ WhitespaceSensitiveMacros: []
208
212
209
213
## Conclusion
210
214
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.
0 commit comments