aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_tex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/language_tex.lua')
-rw-r--r--plugins/language_tex.lua23
1 files changed, 16 insertions, 7 deletions
diff --git a/plugins/language_tex.lua b/plugins/language_tex.lua
index 1bc08f5..9878505 100644
--- a/plugins/language_tex.lua
+++ b/plugins/language_tex.lua
@@ -5,13 +5,22 @@ syntax.add {
files = { "%.tex$" },
comment = "%%",
patterns = {
- { pattern = {"%%", "\n"}, type = "comment" },
- { pattern = "&", type = "operator" },
- { pattern = "\\\\", type = "operator" },
- { pattern = {"%$", "%$"}, type = "operator" },
- { pattern = {"\\%[", "\\]"}, type = "operator" },
- { pattern = {"{", "}"}, type = "keyword" },
- { pattern = "\\%w*", type = "keyword2" },
+ { pattern = "%%.-\n", type = "comment" },
+ { pattern = "\\documentclass().-{()%a%w+()}", type = {"keyword", "symbol", "function", "symbol"} },
+ { pattern = "\\usepackage", type = "keyword" },
+ { pattern = "\\chapter", type = "keyword" },
+ { pattern = "\\section", type = "keyword" },
+ { pattern = "\\subsection", type = "keyword" },
+ { pattern = "\\paragraph", type = "keyword" },
+ { pattern = "\\subparagraph", type = "keyword" },
+ { pattern = "\\begin(){()%a%w+()}", type = {"keyword2", "symbol", "function", "symbol"} },
+ { pattern = "\\end(){()%a%w+()}", type = {"keyword2", "symbol", "function", "symbol"} },
+ { pattern = "\\%a%w+()%*", type = {"keyword2", "operator"} },
+ { pattern = "\\%a%w+", type = "keyword2" },
+ { pattern = "&", type = "operator" },
+ { pattern = "\\\\", type = "operator" },
+ { pattern = "%$", type = "operator" },
+ { pattern = "\\[%[%]()]", type = "operator" },
},
symbols = {}
}