aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-29 12:54:17 +0100
committerrxi <rxi@users.noreply.github.com>2020-05-29 12:54:17 +0100
commita6723638699352c0f428eee3a40d30bc18b485ce (patch)
treed042078f1c5abfcc3d02f3ebc10485e68de75445
parent7a47b97e21983913b98267484b4fd2a38cef3efa (diff)
parent96cbb139ee92608d56592e41a1a7b97132869664 (diff)
downloadlite-xl-plugins-a6723638699352c0f428eee3a40d30bc18b485ce.tar.gz
lite-xl-plugins-a6723638699352c0f428eee3a40d30bc18b485ce.zip
Merge branch 'master' of https://github.com/rxi/lite-plugins
-rw-r--r--README.md1
-rw-r--r--plugins/language_tex.lua16
2 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index ed9fffd..35f57f6 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,7 @@ Plugin | Description
[`language_psql`](plugins/language_psql.lua?raw=1) | Syntax for the postgresql database access language
[`language_rust`](plugins/language_rust.lua?raw=1) | Syntax for the [Rust](https://rust-lang.org/) programming language
[`language_sh`](plugins/language_sh.lua?raw=1) | Syntax for shell scripting language
+[`language_tex`](plugins/language_tex.lua?raw=1) | Syntax for the [LaTeX](https://www.latex-project.org/) typesetting language
[`language_wren`](plugins/language_wren.lua?raw=1) | Syntax for the [Wren](http://wren.io/) programming language
[`lfautoinsert`](plugins/lfautoinsert.lua?raw=1) | Automatically inserts indentation and closing bracket/text after newline
[`lineguide`](plugins/lineguide.lua?raw=1) | Displays a line-guide at the line limit offset *([screenshot](https://user-images.githubusercontent.com/3920290/81476159-2cf70000-9208-11ea-928b-9dae3884c477.png))*
diff --git a/plugins/language_tex.lua b/plugins/language_tex.lua
new file mode 100644
index 0000000..eced489
--- /dev/null
+++ b/plugins/language_tex.lua
@@ -0,0 +1,16 @@
+local syntax = require "core.syntax"
+
+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" },
+ },
+ symbols = {}
+}