Files
zyedidia.micro/runtime/syntax
Jöran Karl 0859f4aa36 Fix: Syntax highlighting for various issues (#2810)
* highlighter: Fix region & pattern detection

* syntax/sh: Highlight upper case options too

* syntax/c(pp): Try to synchronize the rules to lower the maintenance effort

* syntax/ruby: Fix explicit filename detection in directories

* highlighter: Respect skip rules in regions

* syntax/sh: Fix parameter expansion, cond. flags and generalize filename via ""

* syntax/php|vi: Correct strings in comments to comments only

Additionally improve vimscript comment handling.

* highlighter: Remove problematic start|end check in find(all)Index()

...and additionally remove recursive region end detection
2023-06-05 17:39:12 -07:00
..
2017-12-27 14:27:42 +00:00
2017-03-29 09:45:16 -04:00
2018-07-16 15:37:57 -04:00
2017-03-29 09:45:16 -04:00
2018-10-16 10:39:09 -03:00
2017-03-29 09:45:16 -04:00
2017-03-29 09:45:16 -04:00
2020-04-10 13:57:36 -04:00
2022-12-03 22:17:35 -08:00
2017-03-29 09:45:16 -04:00
2022-05-15 13:00:59 -07:00
2017-03-29 09:45:16 -04:00
2017-03-29 09:45:16 -04:00
2018-05-26 10:08:35 -04:00
2019-04-25 22:45:23 -05:00
2021-05-31 20:26:32 -04:00
2017-03-29 09:45:16 -04:00
2019-05-25 21:01:24 -07:00
2018-05-29 20:02:58 +05:30
2018-08-07 15:16:23 +02:00
2021-02-17 22:27:56 -05:00
2020-01-06 12:06:44 -05:00
2019-11-05 22:57:36 -05:00
2017-03-29 09:45:16 -04:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2023-03-16 13:26:33 -07:00
2022-07-17 12:18:39 -07:00
2017-03-21 14:55:22 -04:00
2017-03-29 09:45:16 -04:00
2017-03-29 09:45:16 -04:00
2020-02-09 00:23:49 -05:00
2017-03-29 09:45:16 -04:00
2017-03-21 14:55:22 -04:00
2017-08-14 11:28:10 -04:00
2017-03-21 14:55:22 -04:00
2020-02-10 00:38:57 -05:00
2021-08-21 18:07:43 -04:00
2018-01-17 23:44:53 -05:00
2017-03-21 14:55:22 -04:00
2019-11-05 22:57:36 -05:00
2017-12-30 12:13:52 -05:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2018-01-30 22:34:44 -05:00
2017-03-29 09:45:16 -04:00
2017-03-21 14:55:22 -04:00
2022-12-09 01:19:19 -08:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2018-03-21 03:58:04 +01:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2019-11-06 07:23:04 -05:00
2017-03-21 14:55:22 -04:00
2017-04-15 02:06:19 +02:00
2021-12-31 18:51:53 -05:00
2019-12-25 16:17:31 -05:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2017-03-21 14:55:22 -04:00
2018-10-02 15:46:38 -04:00
2021-08-21 18:07:43 -04:00
2018-12-21 12:50:33 -05:00
2020-05-26 14:10:27 -04:00
2021-08-06 20:37:42 -04:00
2017-07-11 14:40:38 +02:00
2020-02-13 16:50:44 -05:00
2017-03-21 14:55:22 -04:00
2020-01-06 12:29:33 -05:00
2017-03-21 14:55:22 -04:00
2019-12-04 11:52:22 -07:00
2018-12-13 09:55:19 +01:00

Syntax Files

Here are micro's syntax files.

Each yaml file specifies how to detect the filetype based on file extension or headers (first line of the file). Then there are patterns and regions linked to highlight groups which tell micro how to highlight that filetype.

Making your own syntax files is very simple. I recommend you check the file after you are finished with the syntax_checker.go program (located in this directory). Just place your yaml syntax file in the current directory and run go run syntax_checker.go and it will check every file. If there are no errors it will print No issues!.

You can read more about how to write syntax files (and colorschemes) in the colors documentation.

Legacy '.micro' filetype

Micro used to use the .micro filetype for syntax files which is no longer supported. If you have .micro syntax files that you would like to convert to the new filetype, you can use the syntax_converter.go program (also located in this directory):

$ go run syntax_converter.go c.micro > c.yaml

Most the the syntax files here have been converted using that tool.

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 (about 4 files from this directory had issues after being converted).

Micro syntax highlighting files

These are the syntax highlighting files for micro. To install them, just put all the syntax files in ~/.config/micro/syntax.

They are taken from Nano, specifically from this repository. Micro syntax files are almost identical to Nano's, except for some key differences:

  • Micro does not use icolor. Instead, for a case insensitive match, use the case insensitive flag (i) in the regular expression
    • For example, icolor green ".*" would become color green "(?i).*"

Using with colorschemes

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.

Here is a list of the files that have been converted to properly use colorschemes:

  • vi
  • go
  • c
  • d
  • markdown
  • html
  • lua
  • swift
  • rust
  • java
  • javascript
  • pascal
  • python
  • ruby
  • sh
  • git
  • tex
  • solidity

License

See LICENSE.