aboutsummaryrefslogtreecommitdiff
path: root/data/plugins
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2021-09-16 17:29:44 -0400
committerAdam Harrison <adamdharrison@gmail.com>2021-09-16 17:29:44 -0400
commit4b828eff653dcf899bbaf18db2f8a9ca7dc870e2 (patch)
treee198b45c9ef1efa9062128c47fbaf5e4f9a3bd4a /data/plugins
parent66bfff2e26c20c8d8b4e3325da4ac0dabc9c0b04 (diff)
downloadlite-xl-4b828eff653dcf899bbaf18db2f8a9ca7dc870e2.tar.gz
lite-xl-4b828eff653dcf899bbaf18db2f8a9ca7dc870e2.zip
Markdown subsyntax highlighting.
Diffstat (limited to 'data/plugins')
-rw-r--r--data/plugins/language_md.lua45
1 files changed, 32 insertions, 13 deletions
diff --git a/data/plugins/language_md.lua b/data/plugins/language_md.lua
index 6e6e4255..213bb6cd 100644
--- a/data/plugins/language_md.lua
+++ b/data/plugins/language_md.lua
@@ -1,22 +1,41 @@
-- mod-version:2 -- lite-xl 2.0
local syntax = require "core.syntax"
+
+
syntax.add {
files = { "%.md$", "%.markdown$" },
patterns = {
- { pattern = "\\.", type = "normal" },
- { pattern = { "<!%-%-", "%-%->" }, type = "comment" },
- { pattern = { "```", "```" }, type = "string" },
- { pattern = { "``", "``", "\\" }, type = "string" },
- { pattern = { "`", "`", "\\" }, type = "string" },
- { pattern = { "~~", "~~", "\\" }, type = "keyword2" },
- { pattern = "%-%-%-+", type = "comment" },
- { pattern = "%*%s+", type = "operator" },
- { pattern = { "%*", "[%*\n]", "\\" }, type = "operator" },
- { pattern = { "%_", "[%_\n]", "\\" }, type = "keyword2" },
- { pattern = "#.-\n", type = "keyword" },
- { pattern = "!?%[.-%]%(.-%)", type = "function" },
- { pattern = "https?://%S+", type = "function" },
+ { pattern = "\\.", type = "normal" },
+ { pattern = { "<!%-%-", "%-%->" }, type = "comment" },
+ { pattern = { "```c", "```" }, type = "string", syntax = ".c" },
+ { pattern = { "```c++", "```" }, type = "string", syntax = ".cpp" },
+ { pattern = { "```python", "```" }, type = "string", syntax = ".py" },
+ { pattern = { "```ruby", "```" }, type = "string", syntax = ".rb" },
+ { pattern = { "```perl", "```" }, type = "string", syntax = ".pl" },
+ { pattern = { "```php", "```" }, type = "string", syntax = ".php" },
+ { pattern = { "```javascript", "```" }, type = "string", syntax = ".js" },,
+ { pattern = { "```html", "```" }, type = "string", syntax = ".html" },
+ { pattern = { "```xml", "```" }, type = "string", syntax = ".xml" },
+ { pattern = { "```css", "```" }, type = "string", syntax = ".css" },
+ { pattern = { "```lua", "```" }, type = "string", syntax = ".lua" },
+ { pattern = { "```bash", "```" }, type = "string", syntax = ".sh" },
+ { pattern = { "```java", "```" }, type = "string", syntax = ".java" },
+ { pattern = { "```c#", "```" }, type = "string", syntax = ".cs" },
+ { pattern = { "```cmake", "```" }, type = "string", syntax = ".cmake" },
+ { pattern = { "```d", "```" }, type = "string", syntax = ".d" },
+ { pattern = { "```glsl", "```" }, type = "string", syntax = ".glsl" },
+ { pattern = { "```", "```" }, type = "string" },
+ { pattern = { "``", "``", "\\" }, type = "string" },
+ { pattern = { "`", "`", "\\" }, type = "string" },
+ { pattern = { "~~", "~~", "\\" }, type = "keyword2" },
+ { pattern = "%-%-%-+", type = "comment" },
+ { pattern = "%*%s+", type = "operator" },
+ { pattern = { "%*", "[%*\n]", "\\" }, type = "operator" },
+ { pattern = { "%_", "[%_\n]", "\\" }, type = "keyword2" },
+ { pattern = "#.-\n", type = "keyword" },
+ { pattern = "!?%[.-%]%(.-%)", type = "function" },
+ { pattern = "https?://%S+", type = "function" },
},
symbols = { },
}