diff options
author | Duncan Lock <duncan.lock@gmail.com> | 2021-11-16 20:23:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 12:23:03 +0800 |
commit | 07ab38f038cfde37fe3c7011f07b72fb92c359b1 (patch) | |
tree | dc46c01e40fe0afafb5e1e8c53123499cf25cce0 | |
parent | e51f8ce9abe404a018d1b27101dff9c1fc814425 (diff) | |
download | lite-xl-plugins-07ab38f038cfde37fe3c7011f07b72fb92c359b1.tar.gz lite-xl-plugins-07ab38f038cfde37fe3c7011f07b72fb92c359b1.zip |
Add syntax highlighting for ssh & sshd config files (#85)
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | plugins/language_ssh_config.lua | 58 |
2 files changed, 59 insertions, 0 deletions
@@ -90,6 +90,7 @@ Plugin | Description [`language_ruby`](plugins/language_ruby.lua?raw=1) | Syntax for the [Ruby](https://www.ruby-lang.org/) programming language [`language sass`](plugins/language_sass.lua?raw=1) | Syntax for the [Sass](https://sass-lang.com/) CSS preprocessor [`language_sh`](plugins/language_sh.lua?raw=1) | Syntax for shell scripting language +[`language_ssh_config`](plugins/language_ssh_config.lua?raw=1) | Syntax for ssh & sshd config files [`language_tcl`](plugins/language_tcl.lua?raw=1) | Syntax for the [Tcl](https://www.tcl.tk/) programming language [`language_teal`](plugins/language_teal.lua?raw=1) | Syntax for the [Teal](https://github.com/teal-language/tl) programming language, a typed dialect of Lua. [`language_ts`](plugins/language_ts.lua?raw=1) | Syntax for the [TypeScript](https://www.typescriptlang.org/) programming language, a typed dialect of JavaScript. diff --git a/plugins/language_ssh_config.lua b/plugins/language_ssh_config.lua new file mode 100644 index 0000000..666f3f3 --- /dev/null +++ b/plugins/language_ssh_config.lua @@ -0,0 +1,58 @@ +-- mod-version:2 -- lite-xl 2.0 +local syntax = require "core.syntax" + +syntax.add { + files = { "sshd?/?_?config$" }, + comment = '#', + patterns = { + { pattern = "#.*\n", type = "comment" }, + { pattern = "%d+", type = "number" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + { pattern = "@", type = "operator" }, + }, + symbols = { + -- ssh config + ["Host"] = "function", + ["ProxyCommand"] = "function", + + ["HostName"] = "keyword", + ["IdentityFile"] = "keyword", + ["IdentitiesOnly"] = "keyword", + ["User"] = "keyword", + ["Port"] = "keyword", + + ["ForwardAgent"] = "keyword", + ["ForwardX11"] = "keyword", + ["ForwardX11Trusted"] = "keyword", + ["HostbasedAuthentication"] = "keyword", + ["GSSAPIAuthentication"] = "keyword", + ["GSSAPIDelegateCredentials"] = "keyword", + ["GSSAPIKeyExchange"] = "keyword", + ["GSSAPITrustDNS"] = "keyword", + ["BatchMode"] = "keyword", + ["CheckHostIP"] = "keyword", + ["AddressFamily"] = "keyword", + ["ConnectTimeout"] = "keyword", + ["StrictHostKeyChecking"] = "keyword", + ["Ciphers"] = "keyword", + ["MACs"] = "keyword", + ["EscapeChar"] = "keyword", + ["Tunnel"] = "keyword", + ["TunnelDevice"] = "keyword", + ["PermitLocalCommand"] = "keyword", + ["VisualHostKey"] = "keyword", + ["RekeyLimit"] = "keyword", + ["SendEnv"] = "keyword", + ["HashKnownHosts"] = "keyword", + ["GSSAPIAuthentication"] = "keyword", + + -- sshd config + ["Subsystem"] = "keyword2", + + + ["yes"] = "literal", + ["no"] = "literal", + ["any"] = "literal", + ["ask"] = "literal", + }, +} |