aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFrancesco <francesco.bbt@gmail.com>2021-10-08 20:13:14 +0200
committerGitHub <noreply@github.com>2021-10-08 20:13:14 +0200
commit6b2518a22f46e6571e3da6050c53790d03711e55 (patch)
treefaf3656bf8a28e5bb1d01a47b51d877cdc952e3f /plugins
parent959f30770853c39a666b9fc125bbdff5464be9a2 (diff)
parentc2890cef44e4c9e7c9eb9476db77d5938ef88362 (diff)
downloadlite-xl-plugins-6b2518a22f46e6571e3da6050c53790d03711e55.tar.gz
lite-xl-plugins-6b2518a22f46e6571e3da6050c53790d03711e55.zip
Merge pull request #76 from dflock/patch-5
Add syntax highlighting for .ini files
Diffstat (limited to 'plugins')
-rw-r--r--plugins/language_ini.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/language_ini.lua b/plugins/language_ini.lua
new file mode 100644
index 0000000..f106a57
--- /dev/null
+++ b/plugins/language_ini.lua
@@ -0,0 +1,26 @@
+-- mod-version:2
+
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = { "%.ini$", "%.inf$", "%.cfg$", "%.editorconfig$" },
+ comment = ';',
+ patterns = {
+ { pattern = ";.-\n", type = "comment" },
+ { pattern = "#.-\n", type = "comment" },
+ { pattern = { "%[", "%]" }, type = "keyword" },
+
+ { pattern = { '"""', '"""', '\\' }, type = "string" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'''", "'''" }, type = "string" },
+ { pattern = { "'", "'" }, type = "string" },
+ { pattern = "[A-Za-z0-9_%.%-]+%s*%f[=]", type = "function" },
+ { pattern = "[%-+]?[0-9_]+%.[0-9_]+", type = "number" },
+ { pattern = "[%-+]?[0-9_]+", type = "number" },
+ { pattern = "[a-z]+", type = "symbol" },
+ },
+ symbols = {
+ ["true"] = "literal",
+ ["false"] = "literal",
+ },
+}