aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh-Coder-or-Not <newestideaz@gmail.com>2022-01-17 01:54:11 +0530
committerAsh-Coder-or-Not <newestideaz@gmail.com>2022-01-17 01:54:11 +0530
commite5ce2c06c3af2470aaed18981129503f1ad4d94c (patch)
tree959a1b6b18d9cb91c1f12dde98259228d23299b3
parent2d8a20917b97b64425adedb37f2c0d438b42ab24 (diff)
downloadlite-xl-plugins-e5ce2c06c3af2470aaed18981129503f1ad4d94c.tar.gz
lite-xl-plugins-e5ce2c06c3af2470aaed18981129503f1ad4d94c.zip
adding gemtext highlighting plugin
-rw-r--r--README.md1
-rw-r--r--plugins/language_gmi.lua21
2 files changed, 22 insertions, 0 deletions
diff --git a/README.md b/README.md
index e02f69c..7b459cc 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,7 @@ to something other than a raw file it should be marked with an asterisk.*
| [`language_gdscript`](plugins/language_gdscript.lua?raw=1) | Syntax for the [Godot Engine](https://godotengine.org/)'s GDScript scripting language |
| [`language_glsl`](plugins/language_glsl.lua?raw=1) | Syntax for the [GLSL](https://www.khronos.org/registry/OpenGL/specs/gl/) programming language |
| [`language_go`](plugins/language_go.lua?raw=1) | Syntax for the [Go](https://golang.org/) programming language |
+| [`language_gmi`](plugins/language_gmi.lua?raw=1) | Syntax for the [Gemtext](https://gemini.circumlunar.space/docs/gemtext.gmi) markup language |
| [`language_hlsl`](plugins/language_hlsl.lua?raw=1) | Syntax for the [HLSL](https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl) programming language |
| [`language_hs`](plugins/language_hs.lua?raw=1) | Syntax for the [Haskell](https://www.haskell.org/) programming language |
| [`language_ini`](plugins/language_ini.lua?raw=1) | Syntax for [ini](https://en.wikipedia.org/wiki/INI_file) files |
diff --git a/plugins/language_gmi.lua b/plugins/language_gmi.lua
new file mode 100644
index 0000000..f478126
--- /dev/null
+++ b/plugins/language_gmi.lua
@@ -0,0 +1,21 @@
+-- mod-version:2 -- lite-xl 2.0
+local syntax = require "core.syntax"
+
+
+
+syntax.add {
+ files = { "%.gmi$" },
+ patterns = {
+ { pattern = { "```", "```" }, type = "string" },
+ { pattern = "#.-\n", type = "keyword" },
+ { pattern = "%*.*\n", type = "keyword2" },
+ { pattern = "=>", type = "function" },
+ { pattern = "!?%[.-%]%(.-%)", type = "function" },
+ { pattern = "https?://%S+", type = "literal" },
+ { pattern = "gemini?://%S+", type = "literal" },
+ { pattern = ">.*", type = "comment" },
+ { pattern = ".*[>*#]", type = "normal" },
+ { pattern = ".*=>", type = "normal" }
+ },
+ symbols = { },
+}