diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/language_sh.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/language_sh.lua b/plugins/language_sh.lua new file mode 100644 index 0000000..e76cabc --- /dev/null +++ b/plugins/language_sh.lua @@ -0,0 +1,28 @@ +local syntax = require "core.syntax" + +syntax.add { + files = { "%.sh$" }, + comment = "#", + patterns = { + { pattern = "#.*\n", type = "comment" }, + { pattern = [[\.]], type = "normal" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "%f[%w_][%d%.]+%f[^%w_]", type = "number" }, + { pattern = "[!<>|%[%]=*]", type = "operator" }, + { pattern = "%f[%S]%-[%w%-_]+", type = "function" }, + { pattern = "$[%a_@*][%w_]*", type = "keyword2" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + }, + symbols = { + ["if"] = "keyword", + ["then"] = "keyword", + ["elif"] = "keyword", + ["else"] = "keyword", + ["fi"] = "keyword", + ["echo"] = "keyword", + ["true"] = "literal", + ["false"] = "literal", + }, +} + |