diff options
author | Duncan Lock <duncan.lock@gmail.com> | 2021-10-08 05:19:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-08 05:19:36 -0700 |
commit | 42c4f8ea784e49c4a1e1cb37cf8b21e68c4802e4 (patch) | |
tree | d05d52543c5cb6727637416c8006afe717ef31e3 | |
parent | b53c5eb773b9fd3bd0ea277fe60e2129778cfdb5 (diff) | |
download | lite-xl-plugins-42c4f8ea784e49c4a1e1cb37cf8b21e68c4802e4.tar.gz lite-xl-plugins-42c4f8ea784e49c4a1e1cb37cf8b21e68c4802e4.zip |
Add syntax highlighting for .ini files
-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", + }, +} |