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

Commit

Permalink
feat: syntax highlight (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
taconi authored Dec 7, 2023
1 parent e15a198 commit a7795f1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

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

### Prerequisites

Expand Down
Binary file added assets/syntax_highlight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion editorconfig.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "1.0.0"
VERSION = "1.1.0"

local micro = import("micro")
local microBuffer = import("micro/buffer")
Expand Down Expand Up @@ -155,3 +155,7 @@ end
function init()
config.AddRuntimeFile("editorconfig", config.RTHelp, "help/editorconfig.md")
end

-- outside init because we want these options to take effect before
-- buffers are initialized
config.AddRuntimeFile("editorconfig", config.RTSyntax, "syntax/editorconfig.yaml")
7 changes: 7 additions & 0 deletions repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"Tags": ["editorconfig", "utility", "format"],
"Website": "https://github.com/10sr/editorconfig-micro",
"Versions": [
{
"Version": "1.1.0",
"Url": "https://github.com/10sr/editorconfig-micro/archive/v1.1.0.zip",
"Require": {
"micro": ">=2.0.1"
}
},
{
"Version": "1.0.0",
"Url": "https://github.com/10sr/editorconfig-micro/archive/v1.0.0.zip",
Expand Down
21 changes: 21 additions & 0 deletions syntax/editorconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
filetype: editorconfig

detect:
filename: ".?editor-?config(?:config|-conf)?$"

rules:
# Supported Properties
- statement: "\\b(indent_style|indent_size|tab_width|end_of_line|charset|trim_trailing_whitespace|insert_final_newline|root)\\b"
# Values
- special: "=\\s?.+"
# Files
- identifier: "^[[:space:]]*\\[.*\\]$"
# Brackets
- brightwhite: "\\[|]|{|}|,|="
# Wildcard Patterns
- statement: "\\*|!|\\?"

- comment:
start: "#"
end: "$"
rules: []

0 comments on commit a7795f1

Please sign in to comment.