Skip to content

Commit eec068a

Browse files
authored
help/colors: syntax: document default.yaml (zyedidia#3262)
1 parent 5510317 commit eec068a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

runtime/help/colors.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,3 +395,26 @@ example, the following is possible for html:
395395

396396
Note that nested include (i.e. including syntax files that include other syntax
397397
files) is not supported yet.
398+
399+
### Default syntax highlighting
400+
401+
If micro cannot detect the filetype of the file, it falls back to using the
402+
default syntax highlighting for it, which highlights just the bare minimum:
403+
email addresses, URLs etc.
404+
405+
Just like in other cases, you can override the default highlighting by adding
406+
your own custom `default.yaml` file to `~/.config/micro/syntax`.
407+
408+
For example, if you work with various config files that use the `#` sign to mark
409+
the beginning of a comment, you can use the following custom `default.yaml` to
410+
highlight those comments by default:
411+
412+
```
413+
filetype: unknown
414+
415+
detect:
416+
filename: ""
417+
418+
rules:
419+
- comment: "(^|\\s)#.*$"
420+
```

0 commit comments

Comments
 (0)