settings: Add glob: as prefix for file globbing maps

This gives the advantage to differentiate internal options from user defined
file globs with the same name.
This commit is contained in:
Jöran Karl
2026-03-14 15:20:21 +01:00
parent bcd6c81f50
commit 4f32b47075
2 changed files with 31 additions and 4 deletions

View File

@@ -669,6 +669,21 @@ all files except Go files, and `tabsize` 4 for all files except Ruby files:
Or similarly you can match with globs:
```json
{
"glob:*.go": {
"tabstospaces": false
},
"glob:*.rb": {
"tabsize": 2
},
"tabstospaces": true,
"tabsize": 4
}
```
You can also omit the `glob:` prefix before globs:
```json
{
"*.go": {
@@ -681,3 +696,6 @@ Or similarly you can match with globs:
"tabsize": 4
}
```
But it is generally more recommended to use the `glob:` prefix, as it avoids
potential conflicts with option names.