diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2021-04-24 12:11:16 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2021-04-24 12:11:16 -0400 |
commit | f4e8f7420729143e25faecf9fd98dc5d6051cbe1 (patch) | |
tree | 05db762011ba911df9fbc03d67e57603b3a89e46 /plugins/language_ruby.lua | |
parent | da0d30232e1a64ece2831513c348c1b468751726 (diff) | |
download | lite-xl-plugins-f4e8f7420729143e25faecf9fd98dc5d6051cbe1.tar.gz lite-xl-plugins-f4e8f7420729143e25faecf9fd98dc5d6051cbe1.zip |
Added JSX and Ruby syntax highlighting.
Diffstat (limited to 'plugins/language_ruby.lua')
-rw-r--r-- | plugins/language_ruby.lua | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/plugins/language_ruby.lua b/plugins/language_ruby.lua new file mode 100644 index 0000000..e010f91 --- /dev/null +++ b/plugins/language_ruby.lua @@ -0,0 +1,74 @@ +-- lite-xl 1.16 +local syntax = require "core.syntax" + +syntax.add { + files = { "%.rb", "%.gemspec" }, + headers = "^#!.*[ /]ruby", + comment = "#", + patterns = { + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "-?0x%x+", type = "number" }, + { pattern = "%#.-\n", type = "comment" }, + { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, + { pattern = "-?%.?%d+f?", type = "number" }, + { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "@?@[%a_][%w_]*", type = "keyword2" }, + { pattern = "::[%w_]*", type = "symbol" }, + { pattern = ":[%w_]*", type = "keyword2" }, + { pattern = "[%a_][%w_]*:[^:]", type = "keyword2" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + }, + symbols = { + ["nil"] = "literal", + ["end"] = "literal", + ["true"] = "literal", + ["false"] = "literal", + ["private"] = "keyword", + ["extend"] = "keyword", + ["include"] = "keyword", + ["require"] = "keyword", + ["require_dependency"] = "keyword", + ["__ENCODING__"] = "keyword", + ["__LINE__"] = "keyword", + ["__FILE__"] = "keyword", + ["BEGIN"] = "keyword", + ["END"] = "keyword", + ["alias"] = "keyword", + ["and"] = "keyword", + ["begin"] = "keyword", + ["break"] = "keyword", + ["case"] = "keyword", + ["class"] = "keyword", + ["def"] = "keyword", + ["defined?"] = "keyword", + ["do"] = "keyword", + ["else"] = "keyword", + ["elsif"] = "keyword", + ["end"] = "keyword", + ["ensure"] = "keyword", + ["for"] = "keyword", + ["if"] = "keyword", + ["in"] = "keyword", + ["module"] = "keyword", + ["next"] = "keyword", + ["not"] = "keyword", + ["or"] = "keyword", + ["redo"] = "keyword", + ["rescue"] = "keyword", + ["retry"] = "keyword", + ["return"] = "keyword", + ["self"] = "keyword", + ["super"] = "keyword", + ["then"] = "keyword", + ["true"] = "keyword", + ["undef"] = "keyword", + ["unless"] = "keyword", + ["until"] = "keyword", + ["when"] = "keyword", + ["while"] = "keyword", + ["yield"] = "keyword" + }, +} + |