diff options
author | Aqil Contractor <32044067+AqilCont@users.noreply.github.com> | 2021-03-21 16:14:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-21 16:14:46 -0400 |
commit | f18612d0bfea24547d52a189cb2613f3cc718e68 (patch) | |
tree | 387714de8dabe6f43fa6464bfcd96ee77d2ff048 | |
parent | 225f21ea99c28d2c0f816b3c5cdf879b95248d54 (diff) | |
download | lite-xl-plugins-f18612d0bfea24547d52a189cb2613f3cc718e68.tar.gz lite-xl-plugins-f18612d0bfea24547d52a189cb2613f3cc718e68.zip |
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" + } +} |