]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/README.md
Update syntax readme and docs
[micro.git] / runtime / syntax / README.md
1 # Syntax Files
2
3 Here are micro's syntax files.
4
5 Each yaml file specifies how to detect the filetype based on file extension or headers (first line of the file).
6 Then there are patterns and regions linked to highlight groups which tell micro how to highlight that filetype.
7
8 Making your own syntax files is very simple. I recommend you check the file after you are finished with the
9 [`syntax_checker.go`](./syntax_checker.go) program (located in this directory). Just place your yaml syntax
10 file in the current directory and run `go run syntax_checker.go` and it will check every file. If there are no
11 errors it will print `No issues!`.
12
13 You can read more about how to write syntax files (and colorschemes) in the [colors](../help/colors.md) documentation.
14
15 # Legacy '.micro' filetype
16
17 Micro used to use the `.micro` filetype for syntax files which is no longer supported. If you have `.micro`
18 syntax files that you would like to convert to the new filetype, you can use the [`syntax_converter.go`](./syntax_converter.go) program (also located in this directory):
19
20 ```
21 $ go run syntax_converter.go c.micro > c.yaml
22 ```
23
24 Most the the syntax files here have been converted using that tool.
25
26 Note that the tool isn't perfect and though it is unlikely, you may run into some small issues that you will have to fix manually
27 (about 4 files from this directory had issues after being converted).