-
Notifications
You must be signed in to change notification settings - Fork 4
/
Known Hosts.sublime-syntax
67 lines (64 loc) · 2.54 KB
/
Known Hosts.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
%YAML 1.2
---
# https://www.sublimetext.com/docs/syntax.html
# https://man7.org/linux/man-pages/man8/sshd.8.html#SSH_KNOWN_HOSTS_FILE_FORMAT
# https://man.openbsd.org/sshd.8#SSH_KNOWN_HOSTS_FILE_FORMAT
name: Known Hosts
scope: text.known_hosts
file_extensions:
- known_hosts
hidden_file_extensions:
- known_hosts.old
contexts:
main:
- include: SSH Common.sublime-syntax#comments-number-sign
- match: ^((@)(?:revoked|cert-authority))?
captures:
1: meta.annotation.known_hosts variable.annotation.known_hosts
2: punctuation.definition.annotation.known_hosts
push:
- meta_scope: meta.line.known-host.known_hosts
- include: SSH Common.sublime-syntax#pop-before-nl
- include: SSH Common.sublime-syntax#pop-nl
- match: ','
scope: punctuation.separator.sequence.known_hosts
- include: SSH Common.sublime-syntax#ssh-fingerprint-with-label
- include: SSH Crypto.sublime-syntax#ssh-key-types
- include: hostname-or-ip-value
hostname-or-ip-value:
- match: \[
scope: punctuation.definition.string.begin.known_hosts
push:
- meta_scope: meta.brackets.host.known_hosts
- match: (\])(?:(:)(\d{1,5}))?
captures:
1: punctuation.definition.string.end.known_hosts
2: punctuation.separator.sequence.known_hosts
3: constant.numeric.integer.decimal.known_hosts
pop: true
- match: '!'
scope: keyword.operator.logical.known_hosts
- include: SSH Common.sublime-syntax#ip-addresses
- match: ''
push:
- meta_scope: meta.string.host.known_hosts string.quoted.other.known_hosts
- match: (?=,|\])
pop: true
- match: '[*?]'
scope: keyword.operator.wildcard.known_hosts
- include: SSH Common.sublime-syntax#ip-addresses
- match: (\|)(\d+)(\|)([\w+/]{27}=)(\|)([\w+/]{27}=)
scope: meta.string.host.obfuscated.known_hosts
captures:
1: punctuation.definition.known_hosts
2: constant.numeric.integer.algorithm.known_hosts
3: punctuation.definition.known_hosts
4: string.unquoted.salt.known_hosts
5: punctuation.definition.known_hosts
6: string.unquoted.hash.known_hosts
- match: '!'
scope: keyword.operator.logical.known_hosts
- match: '[*?]'
scope: meta.string.host.known_hosts string.unquoted.known_hosts keyword.operator.wildcard.known_hosts
- match: '[^,\[\s*?]+'
scope: meta.string.host.known_hosts string.unquoted.known_hosts