diff options
author | Francesco <francesco.bbt@gmail.com> | 2021-10-08 20:13:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-08 20:13:14 +0200 |
commit | 6b2518a22f46e6571e3da6050c53790d03711e55 (patch) | |
tree | faf3656bf8a28e5bb1d01a47b51d877cdc952e3f /plugins | |
parent | 959f30770853c39a666b9fc125bbdff5464be9a2 (diff) | |
parent | c2890cef44e4c9e7c9eb9476db77d5938ef88362 (diff) | |
download | lite-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.lua | 26 |
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", + }, +} |