diff options
author | rxi <rxi@users.noreply.github.com> | 2020-06-25 10:59:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 10:59:08 +0100 |
commit | 76144065f71d08ec5eb0ccc7309d847c871a3d11 (patch) | |
tree | e04116b3536cc0482b6c13ef1165113e05d43618 | |
parent | 2446f3c89b54c4554bd54c5f3a1e6d4a8471cac2 (diff) | |
parent | dff4483c481a8f5ae539afb2b427c9dfe89f4a55 (diff) | |
download | lite-xl-plugins-76144065f71d08ec5eb0ccc7309d847c871a3d11.tar.gz lite-xl-plugins-76144065f71d08ec5eb0ccc7309d847c871a3d11.zip |
Merge pull request #66 from lordadamson/master
CMake syntax highlighting
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | plugins/language_cmake.lua | 15 |
2 files changed, 16 insertions, 0 deletions
@@ -32,6 +32,7 @@ Plugin | Description [`indentguide`](plugins/indentguide.lua?raw=1) | Adds indent guides *([screenshot](https://user-images.githubusercontent.com/3920290/79640716-f9860000-818a-11ea-9c3b-26d10dd0e0c0.png))* [`language_angelscript`](plugins/language_angelscript.lua?raw=1) | Syntax for the [Angelscript](https://www.angelcode.com/angelscript/) programming language [`language_batch`](plugins/language_batch.lua?raw=1) | Syntax for Windows [Batch Files](https://en.wikipedia.org/wiki/Batch_file) +[`language_cmake`](plugins/language_cmake.lua?raw=1) | Syntax for the CMake build system language [`language_cpp`](plugins/language_cpp.lua?raw=1) | Syntax for the [C++](https://isocpp.org/) programming language [`language_csharp`](plugins/language_csharp.lua?raw=1) | Syntax for the [C#](http://csharp.net) programming language [`language_d`](plugins/language_d.lua?raw=1) | Syntax for the [D](https://dlang.org/) programming language diff --git a/plugins/language_cmake.lua b/plugins/language_cmake.lua new file mode 100644 index 0000000..78354e1 --- /dev/null +++ b/plugins/language_cmake.lua @@ -0,0 +1,15 @@ +local syntax = require "core.syntax" + +syntax.add { + files = { "%.cmake$", "CMakeLists.txt$" }, + comment = "//", + patterns = { + { pattern = { "#", "[^\\]\n" }, type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "[%a_][%w_]*", type = "normal" }, + { pattern = "%${[%a_][%w_]*%}", type = "operator" }, + }, + symbols = {}, +} |