aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-01-17 19:39:10 +0100
committerGitHub <noreply@github.com>2022-01-17 19:39:10 +0100
commit751d898c82d14367321ba73e78cd21c824a51e30 (patch)
treeea100e4b88907f68e462f96b64e6c74b2f3bf926
parentf5c5fd4b86d85a4a777a10bef083df75ebff42db (diff)
parenta3249fe89f654d4333ff9ab35d0e9ea3fcb23c49 (diff)
downloadlite-xl-plugins-751d898c82d14367321ba73e78cd21c824a51e30.tar.gz
lite-xl-plugins-751d898c82d14367321ba73e78cd21c824a51e30.zip
Merge pull request #20 from Not-a-web-Developer/master
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..742161d 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,7 @@ to something other than a raw file it should be marked with an asterisk.*
| [`language_fstab`](plugins/language_fstab.lua?raw=1) | Syntax for the [fstab](https://en.wikipedia.org/wiki/Fstab) config files |
| [`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_gmi`](plugins/language_gmi.lua?raw=1) | Syntax for the [Gemtext](https://gemini.circumlunar.space/docs/gemtext.gmi) markup language |
| [`language_go`](plugins/language_go.lua?raw=1) | Syntax for the [Go](https://golang.org/) programming 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 |
diff --git a/plugins/language_gmi.lua b/plugins/language_gmi.lua
new file mode 100644
index 0000000..a6ef4d8
--- /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 {
+ name = "Gemtext",
+ files = { "%.gmi$" },
+ patterns = {
+ { pattern = { "```", "```" }, type = "string" },
+ { pattern = "#.*", type = "keyword" },
+ { pattern = "%*%s", type = "keyword2" },
+ { pattern = "=>", type = "function" },
+ { pattern = "https?://%S+", type = "literal" },
+ { pattern = "gemini?://%S+", type = "literal" },
+ { pattern = ">.*", type = "comment" },
+ { pattern = ".*[>*#]", type = "normal" },
+ { pattern = ".*=>", type = "normal" }
+ },
+ symbols = { },
+}