honeylisp/vendor/lite-plugins/plugins/language_sh.lua
Jeremy Penner cb5132f393 git subrepo clone https://github.com/rxi/lite-plugins vendor/lite-plugins
subrepo:
  subdir:   "vendor/lite-plugins"
  merged:   "de4227d"
upstream:
  origin:   "https://github.com/rxi/lite-plugins"
  branch:   "master"
  commit:   "de4227d"
git-subrepo:
  version:  "0.4.2"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "65fde50"
2020-11-19 21:04:39 -05:00

43 lines
1.4 KiB
Lua

local syntax = require "core.syntax"
syntax.add {
files = { "%.sh$" },
headers = "^#!.*bin.*sh\n",
comment = "#",
patterns = {
{ pattern = "#.*\n", type = "comment" },
{ pattern = [[\.]], type = "normal" },
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
{ pattern = { '`', '`', '\\' }, type = "string" },
{ pattern = "%f[%w_][%d%.]+%f[^%w_]", type = "number" },
{ pattern = "[!<>|&%[%]=*]", type = "operator" },
{ pattern = "%f[%S]%-[%w%-_]+", type = "function" },
{ pattern = "${.*}", type = "keyword2" },
{ pattern = "$[%a_@*][%w_]*", type = "keyword2" },
{ pattern = "[%a_][%w_]*", type = "symbol" },
},
symbols = {
["case"] = "keyword",
["do"] = "keyword",
["done"] = "keyword",
["elif"] = "keyword",
["else"] = "keyword",
["esac"] = "keyword",
["fi"] = "keyword",
["for"] = "keyword",
["function"] = "keyword",
["if"] = "keyword",
["in"] = "keyword",
["select"] = "keyword",
["then"] = "keyword",
["time"] = "keyword",
["until"] = "keyword",
["while"] = "keyword",
["echo"] = "keyword",
["true"] = "literal",
["false"] = "literal",
},
}