xref: /vim-8.2.3635/runtime/syntax/sshconfig.vim (revision 818c9e7e)
1" Vim syntax file
2" Language:	OpenSSH client configuration file (ssh_config)
3" Author:	David Necas (Yeti)
4" Maintainer:	Dominik Fischer <d dot f dot fischer at web dot de>
5" Contributor:  Leonard Ehrenfried <[email protected]>
6" Contributor:  Karsten Hopp <[email protected]>
7" Last Change:	2016 Mar 1
8" SSH Version:	7.2
9"
10
11" Setup
12if version >= 600
13  if exists("b:current_syntax")
14    finish
15  endif
16else
17  syntax clear
18endif
19
20if version >= 600
21  setlocal iskeyword=_,-,a-z,A-Z,48-57
22else
23  set iskeyword=_,-,a-z,A-Z,48-57
24endif
25
26
27" case on
28syn case match
29
30
31" Comments
32syn match sshconfigComment "^#.*$" contains=sshconfigTodo
33syn match sshconfigComment "\s#.*$" contains=sshconfigTodo
34
35syn keyword sshconfigTodo TODO FIXME NOTE contained
36
37
38" Constants
39syn keyword sshconfigYesNo yes no ask
40syn keyword sshconfigYesNo any auto
41syn keyword sshconfigYesNo force autoask none
42
43syn keyword sshconfigCipher 3des blowfish
44
45syn keyword sshconfigCiphers 3des-cbc
46syn keyword sshconfigCiphers blowfish-cbc
47syn keyword sshconfigCiphers cast128-cbc
48syn keyword sshconfigCiphers arcfour
49syn keyword sshconfigCiphers arcfour128
50syn keyword sshconfigCiphers arcfour256
51syn keyword sshconfigCiphers aes128-cbc
52syn keyword sshconfigCiphers aes192-cbc
53syn keyword sshconfigCiphers aes256-cbc
54syn match sshconfigCiphers "\<rijndael-cbc@lysator\.liu.se\>"
55syn keyword sshconfigCiphers aes128-ctr
56syn keyword sshconfigCiphers aes192-ctr
57syn keyword sshconfigCiphers aes256-ctr
58syn match sshconfigCiphers "\<aes128-gcm@openssh\.com\>"
59syn match sshconfigCiphers "\<aes256-gcm@openssh\.com\>"
60syn match sshconfigCiphers "\<chacha20-poly1305@openssh\.com\>"
61
62syn keyword sshconfigMAC hmac-sha1
63syn keyword sshconfigMAC mac-sha1-96
64syn keyword sshconfigMAC mac-sha2-256
65syn keyword sshconfigMAC mac-sha2-512
66syn keyword sshconfigMAC mac-md5
67syn keyword sshconfigMAC mac-md5-96
68syn keyword sshconfigMAC mac-ripemd160
69syn match   sshconfigMAC "\<hmac-ripemd160@openssh\.com\>"
70syn match   sshconfigMAC "\<umac-64@openssh\.com\>"
71syn match   sshconfigMAC "\<umac-128@openssh\.com\>"
72syn match   sshconfigMAC "\<hmac-sha1-etm@openssh\.com\>"
73syn match   sshconfigMAC "\<hmac-sha1-96-etm@openssh\.com\>"
74syn match   sshconfigMAC "\<hmac-sha2-256-etm@openssh\.com\>"
75syn match   sshconfigMAC "\<hmac-sha2-512-etm@openssh\.com\>"
76syn match   sshconfigMAC "\<hmac-md5-etm@openssh\.com\>"
77syn match   sshconfigMAC "\<hmac-md5-96-etm@openssh\.com\>"
78syn match   sshconfigMAC "\<hmac-ripemd160-etm@openssh\.com\>"
79syn match   sshconfigMAC "\<umac-64-etm@openssh\.com\>"
80syn match   sshconfigMAC "\<umac-128-etm@openssh\.com\>"
81
82syn keyword sshconfigHostKeyAlgo ssh-ed25519
83syn match sshconfigHostKeyAlgo "\<ssh-ed25519-cert-v01@openssh\.com\>"
84syn keyword sshconfigHostKeyAlgo ssh-rsa
85syn keyword sshconfigHostKeyAlgo ssh-dss
86syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp256
87syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp384
88syn keyword sshconfigHostKeyAlgo ecdsa-sha2-nistp521
89syn match sshconfigHostKeyAlgo "\<ssh-rsa-cert-v01@openssh\.com\>"
90syn match sshconfigHostKeyAlgo "\<ssh-dss-cert-v01@openssh\.com\>"
91syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp256-cert-v01@openssh\.com\>"
92syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp384-cert-v01@openssh\.com\>"
93syn match sshconfigHostKeyAlgo "\<ecdsa-sha2-nistp521-cert-v01@openssh\.com\>"
94
95syn keyword sshconfigPreferredAuth hostbased publickey password gssapi-with-mic
96syn keyword sshconfigPreferredAuth keyboard-interactive
97
98syn keyword sshconfigLogLevel QUIET FATAL ERROR INFO VERBOSE
99syn keyword sshconfigLogLevel DEBUG DEBUG1 DEBUG2 DEBUG3
100syn keyword sshconfigSysLogFacility DAEMON USER AUTH AUTHPRIV LOCAL0 LOCAL1
101syn keyword sshconfigSysLogFacility LOCAL2 LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7
102syn keyword sshconfigAddressFamily  inet inet6
103
104syn match   sshconfigIPQoS	"af1[123]"
105syn match   sshconfigIPQoS	"af2[123]"
106syn match   sshconfigIPQoS	"af3[123]"
107syn match   sshconfigIPQoS	"af4[123]"
108syn match   sshconfigIPQoS	"cs[0-7]"
109syn keyword sshconfigIPQoS	ef lowdelay throughput reliability
110syn keyword sshconfigKbdInteractive bsdauth pam skey
111
112syn keyword sshconfigKexAlgo diffie-hellman-group1-sha1
113syn keyword sshconfigKexAlgo diffie-hellman-group14-sha1
114syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha1
115syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha256
116syn keyword sshconfigKexAlgo ecdh-sha2-nistp256
117syn keyword sshconfigKexAlgo ecdh-sha2-nistp384
118syn keyword sshconfigKexAlgo ecdh-sha2-nistp521
119syn match sshconfigKexAlgo "\<curve25519-sha256@libssh\.org\>"
120
121syn keyword sshconfigTunnel	point-to-point ethernet
122
123syn match sshconfigVar "%[rhplLdun]\>"
124syn match sshconfigSpecial "[*?]"
125syn match sshconfigNumber "\d\+"
126syn match sshconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>"
127syn match sshconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>"
128syn match sshconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}[:/]\d\+\>"
129syn match sshconfigHostPort "\(Host \)\@<=.\+"
130syn match sshconfigHostPort "\(HostName \)\@<=.\+"
131
132" case off
133syn case ignore
134
135
136" Keywords
137syn keyword sshconfigHostSect Host
138
139syn keyword sshconfigMatch canonical exec host originalhost user localuser all
140
141syn keyword sshconfigKeyword AddressFamily
142syn keyword sshconfigKeyword BatchMode
143syn keyword sshconfigKeyword BindAddress
144syn keyword sshconfigKeyword CanonicalDomains
145syn keyword sshconfigKeyword CanonicalizeFallbackLocal
146syn keyword sshconfigKeyword CanonicalizeHostname
147syn keyword sshconfigKeyword CanonicalizeMaxDots
148syn keyword sshconfigKeyword CertificateFile
149syn keyword sshconfigKeyword ChallengeResponseAuthentication
150syn keyword sshconfigKeyword CheckHostIP
151syn keyword sshconfigKeyword Cipher
152syn keyword sshconfigKeyword Ciphers
153syn keyword sshconfigKeyword ClearAllForwardings
154syn keyword sshconfigKeyword Compression
155syn keyword sshconfigKeyword CompressionLevel
156syn keyword sshconfigKeyword ConnectTimeout
157syn keyword sshconfigKeyword ConnectionAttempts
158syn keyword sshconfigKeyword ControlMaster
159syn keyword sshconfigKeyword ControlPath
160syn keyword sshconfigKeyword ControlPersist
161syn keyword sshconfigKeyword DynamicForward
162syn keyword sshconfigKeyword EnableSSHKeysign
163syn keyword sshconfigKeyword EscapeChar
164syn keyword sshconfigKeyword ExitOnForwardFailure
165syn keyword sshconfigKeyword ForwardAgent
166syn keyword sshconfigKeyword ForwardX11
167syn keyword sshconfigKeyword ForwardX11Timeout
168syn keyword sshconfigKeyword ForwardX11Trusted
169syn keyword sshconfigKeyword GSSAPIAuthentication
170syn keyword sshconfigKeyword GSSAPIClientIdentity
171syn keyword sshconfigKeyword GSSAPIDelegateCredentials
172syn keyword sshconfigKeyword GSSAPIKeyExchange
173syn keyword sshconfigKeyword GSSAPIRenewalForcesRekey
174syn keyword sshconfigKeyword GSSAPIServerIdentity
175syn keyword sshconfigKeyword GSSAPITrustDNS
176syn keyword sshconfigKeyword GSSAPITrustDns
177syn keyword sshconfigKeyword GatewayPorts
178syn keyword sshconfigKeyword GlobalKnownHostsFile
179syn keyword sshconfigKeyword HashKnownHosts
180syn keyword sshconfigKeyword HostKeyAlgorithms
181syn keyword sshconfigKeyword HostKeyAlias
182syn keyword sshconfigKeyword HostName
183syn keyword sshconfigKeyword HostbasedAuthentication
184syn keyword sshconfigKeyword HostbasedKeyTypes
185syn keyword sshconfigKeyword IPQoS
186syn keyword sshconfigKeyword IdentitiesOnly
187syn keyword sshconfigKeyword IdentityFile
188syn keyword sshconfigKeyword IgnoreUnknown
189syn keyword sshconfigKeyword IPQoS
190syn keyword sshconfigKeyword KbdInteractiveAuthentication
191syn keyword sshconfigKeyword KbdInteractiveDevices
192syn keyword sshconfigKeyword KexAlgorithms
193syn keyword sshconfigKeyword LocalCommand
194syn keyword sshconfigKeyword LocalForward
195syn keyword sshconfigKeyword LogLevel
196syn keyword sshconfigKeyword MACs
197syn keyword sshconfigKeyword Match
198syn keyword sshconfigKeyword NoHostAuthenticationForLocalhost
199syn keyword sshconfigKeyword NumberOfPasswordPrompts
200syn keyword sshconfigKeyword PKCS11Provider
201syn keyword sshconfigKeyword PasswordAuthentication
202syn keyword sshconfigKeyword PermitLocalCommand
203syn keyword sshconfigKeyword Port
204syn keyword sshconfigKeyword PreferredAuthentications
205syn keyword sshconfigKeyword Protocol
206syn keyword sshconfigKeyword ProxyCommand
207syn keyword sshconfigKeyword ProxyUseFDPass
208syn keyword sshconfigKeyword PubkeyAcceptedKeyTypes
209syn keyword sshconfigKeyword PubkeyAuthentication
210syn keyword sshconfigKeyword RSAAuthentication
211syn keyword sshconfigKeyword RekeyLimit
212syn keyword sshconfigKeyword RemoteForward
213syn keyword sshconfigKeyword RequestTTY
214syn keyword sshconfigKeyword RhostsRSAAuthentication
215syn keyword sshconfigKeyword SendEnv
216syn keyword sshconfigKeyword ServerAliveCountMax
217syn keyword sshconfigKeyword ServerAliveInterval
218syn keyword sshconfigKeyword SmartcardDevice
219syn keyword sshconfigKeyword StrictHostKeyChecking
220syn keyword sshconfigKeyword TCPKeepAlive
221syn keyword sshconfigKeyword Tunnel
222syn keyword sshconfigKeyword TunnelDevice
223syn keyword sshconfigKeyword UseBlacklistedKeys
224syn keyword sshconfigKeyword UsePrivilegedPort
225syn keyword sshconfigKeyword User
226syn keyword sshconfigKeyword UserKnownHostsFile
227syn keyword sshconfigKeyword UseRoaming
228syn keyword sshconfigKeyword VerifyHostKeyDNS
229syn keyword sshconfigKeyword VisualHostKey
230syn keyword sshconfigKeyword XAuthLocation
231
232" Define the default highlighting
233if version >= 508 || !exists("did_sshconfig_syntax_inits")
234  if version < 508
235    let did_sshconfig_syntax_inits = 1
236    command -nargs=+ HiLink hi link <args>
237  else
238    command -nargs=+ HiLink hi def link <args>
239  endif
240
241  HiLink sshconfigComment        Comment
242  HiLink sshconfigTodo           Todo
243  HiLink sshconfigHostPort       sshconfigConstant
244  HiLink sshconfigNumber         sshconfigConstant
245  HiLink sshconfigConstant       Constant
246  HiLink sshconfigYesNo          sshconfigEnum
247  HiLink sshconfigCipher         sshconfigEnum
248  HiLink sshconfigCiphers	 sshconfigEnum
249  HiLink sshconfigMAC            sshconfigEnum
250  HiLink sshconfigHostKeyAlgo    sshconfigEnum
251  HiLink sshconfigLogLevel       sshconfigEnum
252  HiLink sshconfigSysLogFacility sshconfigEnum
253  HiLink sshconfigAddressFamily  sshconfigEnum
254  HiLink sshconfigIPQoS		 sshconfigEnum
255  HiLink sshconfigKbdInteractive sshconfigEnum
256  HiLink sshconfigKexAlgo	 sshconfigEnum
257  HiLink sshconfigTunnel	 sshconfigEnum
258  HiLink sshconfigPreferredAuth  sshconfigEnum
259  HiLink sshconfigVar            sshconfigEnum
260  HiLink sshconfigEnum           Identifier
261  HiLink sshconfigSpecial        Special
262  HiLink sshconfigKeyword        Keyword
263  HiLink sshconfigHostSect       Type
264  HiLink sshconfigMatch          Type
265  delcommand HiLink
266endif
267
268let b:current_syntax = "sshconfig"
269
270" vim:set ts=8 sw=2 sts=2:
271