Skip to content

Commit 07ab38f

Browse files
authored
Add syntax highlighting for ssh & sshd config files (rxi#85)
1 parent e51f8ce commit 07ab38f

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Plugin | Description
9090
[`language_ruby`](plugins/language_ruby.lua?raw=1) | Syntax for the [Ruby](https://www.ruby-lang.org/) programming language
9191
[`language sass`](plugins/language_sass.lua?raw=1) | Syntax for the [Sass](https://sass-lang.com/) CSS preprocessor
9292
[`language_sh`](plugins/language_sh.lua?raw=1) | Syntax for shell scripting language
93+
[`language_ssh_config`](plugins/language_ssh_config.lua?raw=1) | Syntax for ssh & sshd config files
9394
[`language_tcl`](plugins/language_tcl.lua?raw=1) | Syntax for the [Tcl](https://www.tcl.tk/) programming language
9495
[`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.
9596
[`language_ts`](plugins/language_ts.lua?raw=1) | Syntax for the [TypeScript](https://www.typescriptlang.org/) programming language, a typed dialect of JavaScript.

plugins/language_ssh_config.lua

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
-- mod-version:2 -- lite-xl 2.0
2+
local syntax = require "core.syntax"
3+
4+
syntax.add {
5+
files = { "sshd?/?_?config$" },
6+
comment = '#',
7+
patterns = {
8+
{ pattern = "#.*\n", type = "comment" },
9+
{ pattern = "%d+", type = "number" },
10+
{ pattern = "[%a_][%w_]*", type = "symbol" },
11+
{ pattern = "@", type = "operator" },
12+
},
13+
symbols = {
14+
-- ssh config
15+
["Host"] = "function",
16+
["ProxyCommand"] = "function",
17+
18+
["HostName"] = "keyword",
19+
["IdentityFile"] = "keyword",
20+
["IdentitiesOnly"] = "keyword",
21+
["User"] = "keyword",
22+
["Port"] = "keyword",
23+
24+
["ForwardAgent"] = "keyword",
25+
["ForwardX11"] = "keyword",
26+
["ForwardX11Trusted"] = "keyword",
27+
["HostbasedAuthentication"] = "keyword",
28+
["GSSAPIAuthentication"] = "keyword",
29+
["GSSAPIDelegateCredentials"] = "keyword",
30+
["GSSAPIKeyExchange"] = "keyword",
31+
["GSSAPITrustDNS"] = "keyword",
32+
["BatchMode"] = "keyword",
33+
["CheckHostIP"] = "keyword",
34+
["AddressFamily"] = "keyword",
35+
["ConnectTimeout"] = "keyword",
36+
["StrictHostKeyChecking"] = "keyword",
37+
["Ciphers"] = "keyword",
38+
["MACs"] = "keyword",
39+
["EscapeChar"] = "keyword",
40+
["Tunnel"] = "keyword",
41+
["TunnelDevice"] = "keyword",
42+
["PermitLocalCommand"] = "keyword",
43+
["VisualHostKey"] = "keyword",
44+
["RekeyLimit"] = "keyword",
45+
["SendEnv"] = "keyword",
46+
["HashKnownHosts"] = "keyword",
47+
["GSSAPIAuthentication"] = "keyword",
48+
49+
-- sshd config
50+
["Subsystem"] = "keyword2",
51+
52+
53+
["yes"] = "literal",
54+
["no"] = "literal",
55+
["any"] = "literal",
56+
["ask"] = "literal",
57+
},
58+
}

0 commit comments

Comments
 (0)