]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/README.md
Merge branch 'master' into view-refactor
[micro.git] / runtime / syntax / README.md
1 <<<<<<< HEAD
2 # Syntax Files
3
4 Here are micro's syntax files.
5
6 Each yaml file specifies how to detect the filetype based on file extension or headers (first line of the file).
7 Then there are patterns and regions linked to highlight groups which tell micro how to highlight that filetype.
8
9 Making your own syntax files is very simple. I recommend you check the file after you are finished with the
10 [`syntax_checker.go`](./syntax_checker.go) program (located in this directory). Just place your yaml syntax
11 file in the current directory and run `go run syntax_checker.go` and it will check every file. If there are no
12 errors it will print `No issues!`.
13
14 You can read more about how to write syntax files (and colorschemes) in the [colors](../help/colors.md) documentation.
15
16 # Legacy '.micro' filetype
17
18 Micro used to use the `.micro` filetype for syntax files which is no longer supported. If you have `.micro`
19 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):
20
21 ```
22 $ go run syntax_converter.go c.micro > c.yaml
23 ```
24
25 Most the the syntax files here have been converted using that tool.
26
27 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
28 (about 4 files from this directory had issues after being converted).
29 =======
30 # Micro syntax highlighting files
31
32 These are the syntax highlighting files for micro. To install them, just
33 put all the syntax files in `~/.config/micro/syntax`.
34
35 They are taken from Nano, specifically from [this repository](https://github.com/scopatz/nanorc).
36 Micro syntax files are almost identical to Nano's, except for some key differences:
37
38 * Micro does not use `icolor`. Instead, for a case insensitive match, use the case insensitive flag (`i`) in the regular expression
39     * For example, `icolor green ".*"` would become `color green "(?i).*"`
40
41 # Using with colorschemes
42
43 Not all of these files have been converted to use micro's colorscheme feature. Most of them just hardcode the colors, which can be problematic depending on the colorscheme you use.
44
45 Here is a list of the files that have been converted to properly use colorschemes:
46
47 * vi
48 * go
49 * c
50 * d
51 * markdown
52 * html
53 * lua
54 * swift
55 * rust
56 * java
57 * javascript
58 * pascal
59 * python
60 * ruby
61 * sh
62 * git
63 * tex
64 * solidity
65
66 # License
67
68 Because the nano syntax files I have modified are distributed under the GNU GPLv3 license, these files are also distributed
69 under that license. See [LICENSE](LICENSE).
70 >>>>>>> master