Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit a7795f1

Browse files
author
taconi
authored
feat: syntax highlight (#13)
1 parent e15a198 commit a7795f1

5 files changed

Lines changed: 34 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[EditorConfig] plugin for the [`micro`] editor. Works with `micro` v2.
44

5+
![Syntax Highlight](https://raw.githubusercontent.com/10sr/editorconfig-micro/master/assets/syntax_highlight.png)
56

67
### Prerequisites
78

assets/syntax_highlight.png

52.8 KB
Loading

editorconfig.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "1.0.0"
1+
VERSION = "1.1.0"
22

33
local micro = import("micro")
44
local microBuffer = import("micro/buffer")
@@ -155,3 +155,7 @@ end
155155
function init()
156156
config.AddRuntimeFile("editorconfig", config.RTHelp, "help/editorconfig.md")
157157
end
158+
159+
-- outside init because we want these options to take effect before
160+
-- buffers are initialized
161+
config.AddRuntimeFile("editorconfig", config.RTSyntax, "syntax/editorconfig.yaml")

repo.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
"Tags": ["editorconfig", "utility", "format"],
55
"Website": "https://github.com/10sr/editorconfig-micro",
66
"Versions": [
7+
{
8+
"Version": "1.1.0",
9+
"Url": "https://github.com/10sr/editorconfig-micro/archive/v1.1.0.zip",
10+
"Require": {
11+
"micro": ">=2.0.1"
12+
}
13+
},
714
{
815
"Version": "1.0.0",
916
"Url": "https://github.com/10sr/editorconfig-micro/archive/v1.0.0.zip",

syntax/editorconfig.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
filetype: editorconfig
2+
3+
detect:
4+
filename: ".?editor-?config(?:config|-conf)?$"
5+
6+
rules:
7+
# Supported Properties
8+
- statement: "\\b(indent_style|indent_size|tab_width|end_of_line|charset|trim_trailing_whitespace|insert_final_newline|root)\\b"
9+
# Values
10+
- special: "=\\s?.+"
11+
# Files
12+
- identifier: "^[[:space:]]*\\[.*\\]$"
13+
# Brackets
14+
- brightwhite: "\\[|]|{|}|,|="
15+
# Wildcard Patterns
16+
- statement: "\\*|!|\\?"
17+
18+
- comment:
19+
start: "#"
20+
end: "$"
21+
rules: []

0 commit comments

Comments
 (0)