diff options
author | Francesco <francesco.bbt@gmail.com> | 2021-03-21 21:18:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-21 21:18:04 +0100 |
commit | 0de13d8b77e18286412e53a60175b9c64e67a052 (patch) | |
tree | 387714de8dabe6f43fa6464bfcd96ee77d2ff048 | |
parent | 225f21ea99c28d2c0f816b3c5cdf879b95248d54 (diff) | |
parent | f18612d0bfea24547d52a189cb2613f3cc718e68 (diff) | |
download | lite-xl-plugins-0de13d8b77e18286412e53a60175b9c64e67a052.tar.gz lite-xl-plugins-0de13d8b77e18286412e53a60175b9c64e67a052.zip |
Merge pull request #3 from AqilCont/patch-1
Add syntax highlighting for sass.
-rw-r--r-- | plugins/language_sass.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/plugins/language_sass.lua b/plugins/language_sass.lua new file mode 100644 index 0000000..5b043c1 --- /dev/null +++ b/plugins/language_sass.lua @@ -0,0 +1,45 @@ +local syntax = require "core.syntax" + +syntax.add { + files = { "%.sass$" }, + comment = "//", + patterns = { + { pattern = "/[/%*].-\n", type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "$%w+", type = "keyword" }, + { pattern = "@%w+", type = "literal" }, + { pattern = "[#,]%w+", type = "function" }, + { pattern = "&", type = "keyword2" }, + { pattern = "[:%/%*%-]", type = "operator" }, + { pattern = "[%a][%w-]*%s*%f[:]", type = "keyword2" }, + { pattern = "-?%d+[%d%.]*p[xt]", type = "number" }, + { pattern = "-?%d+[%d%.]*deg", type = "number" }, + { pattern = "-?%d+[%d%.]*[s%%]", type = "number" }, + { pattern = "-?%d+[%d%.]*", type = "number" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + }, + symbols = { + ["transparent"] = "literal", + ["none"] = "literal", + ["absolute"] = "literal", + ["relative"] = "literal", + ["solid"] = "literal", + ["flex"] = "literal", + ["flex-start"] = "literal", + ["flex-end"] = "literal", + ["row"] = "literal", + ["center"] = "literal", + ["column"] = "literal", + ["pointer"] = "literal", + ["ease"] = "literal", + ["white"] = "function", + ["black"] = "function", + ["gray"] = "function", + ["blue"] = "function", + ["red"] = "function", + ["purple"] = "function", + ["green"] = "function", + ["yellow"] = "function" + } +} |