ldapconf.vim 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. " Vim syntax file
  2. " Language: ldap.conf(5) configuration file.
  3. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision: 2006-12-11
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. let s:cpo_save = &cpo
  9. set cpo&vim
  10. syn keyword ldapconfTodo contained TODO FIXME XXX NOTE
  11. syn region ldapconfComment display oneline start='^\s*#' end='$'
  12. \ contains=ldapconfTodo,
  13. \ @Spell
  14. syn match ldapconfBegin display '^'
  15. \ nextgroup=ldapconfOption,
  16. \ ldapconfDeprOption,
  17. \ ldapconfComment
  18. syn case ignore
  19. syn keyword ldapconfOption contained URI
  20. \ nextgroup=ldapconfURI
  21. \ skipwhite
  22. syn keyword ldapconfOption contained
  23. \ BASE
  24. \ BINDDN
  25. \ nextgroup=ldapconfDNAttrType
  26. \ skipwhite
  27. syn keyword ldapconfDeprOption contained
  28. \ HOST
  29. \ nextgroup=ldapconfHost
  30. \ skipwhite
  31. syn keyword ldapconfDeprOption contained
  32. \ PORT
  33. \ nextgroup=ldapconfPort
  34. \ skipwhite
  35. syn keyword ldapconfOption contained
  36. \ REFERRALS
  37. \ nextgroup=ldapconfBoolean
  38. \ skipwhite
  39. syn keyword ldapconfOption contained
  40. \ SIZELIMIT
  41. \ TIMELIMIT
  42. \ nextgroup=ldapconfInteger
  43. \ skipwhite
  44. syn keyword ldapconfOption contained
  45. \ DEREF
  46. \ nextgroup=ldapconfDerefWhen
  47. \ skipwhite
  48. syn keyword ldapconfOption contained
  49. \ SASL_MECH
  50. \ nextgroup=ldapconfSASLMechanism
  51. \ skipwhite
  52. syn keyword ldapconfOption contained
  53. \ SASL_REALM
  54. \ nextgroup=ldapconfSASLRealm
  55. \ skipwhite
  56. syn keyword ldapconfOption contained
  57. \ SASL_AUTHCID
  58. \ SASL_AUTHZID
  59. \ nextgroup=ldapconfSASLAuthID
  60. \ skipwhite
  61. syn keyword ldapconfOption contained
  62. \ SASL_SECPROPS
  63. \ nextgroup=ldapconfSASLSecProps
  64. \ skipwhite
  65. syn keyword ldapconfOption contained
  66. \ TLS_CACERT
  67. \ TLS_CERT
  68. \ TLS_KEY
  69. \ TLS_RANDFILE
  70. \ nextgroup=ldapconfFilename
  71. \ skipwhite
  72. syn keyword ldapconfOption contained
  73. \ TLS_CACERTDIR
  74. \ nextgroup=ldapconfPath
  75. \ skipwhite
  76. syn keyword ldapconfOption contained
  77. \ TLS_CIPHER_SUITE
  78. \ nextgroup=@ldapconfTLSCipher
  79. \ skipwhite
  80. syn keyword ldapconfOption contained
  81. \ TLS_REQCERT
  82. \ nextgroup=ldapconfTLSCertCheck
  83. \ skipwhite
  84. syn keyword ldapconfOption contained
  85. \ TLS_CRLCHECK
  86. \ nextgroup=ldapconfTLSCRLCheck
  87. \ skipwhite
  88. syn case match
  89. syn match ldapconfURI contained display
  90. \ 'ldaps\=://[^[:space:]:]\+\%(:\d\+\)\='
  91. \ nextgroup=ldapconfURI
  92. \ skipwhite
  93. " LDAP Distinguished Names are defined in Section 3 of RFC 2253:
  94. " http://www.ietf.org/rfc/rfc2253.txt.
  95. syn match ldapconfDNAttrType contained display
  96. \ '\a[a-zA-Z0-9-]\+\|\d\+\%(\.\d\+\)*'
  97. \ nextgroup=ldapconfDNAttrTypeEq
  98. syn match ldapconfDNAttrTypeEq contained display
  99. \ '='
  100. \ nextgroup=ldapconfDNAttrValue
  101. syn match ldapconfDNAttrValue contained display
  102. \ '\%([^,=+<>#;\\"]\|\\\%([,=+<>#;\\"]\|\x\x\)\)*\|#\%(\x\x\)\+\|"\%([^\\"]\|\\\%([,=+<>#;\\"]\|\x\x\)\)*"'
  103. \ nextgroup=ldapconfDNSeparator
  104. syn match ldapconfDNSeparator contained display
  105. \ '[+,]'
  106. \ nextgroup=ldapconfDNAttrType
  107. syn match ldapconfHost contained display
  108. \ '[^[:space:]:]\+\%(:\d\+\)\='
  109. \ nextgroup=ldapconfHost
  110. \ skipwhite
  111. syn match ldapconfPort contained display
  112. \ '\d\+'
  113. syn keyword ldapconfBoolean contained
  114. \ on
  115. \ true
  116. \ yes
  117. \ off
  118. \ false
  119. \ no
  120. syn match ldapconfInteger contained display
  121. \ '\d\+'
  122. syn keyword ldapconfDerefWhen contained
  123. \ never
  124. \ searching
  125. \ finding
  126. \ always
  127. " Taken from http://www.iana.org/assignments/sasl-mechanisms.
  128. syn keyword ldapconfSASLMechanism contained
  129. \ KERBEROS_V4
  130. \ GSSAPI
  131. \ SKEY
  132. \ EXTERNAL
  133. \ ANONYMOUS
  134. \ OTP
  135. \ PLAIN
  136. \ SECURID
  137. \ NTLM
  138. \ NMAS_LOGIN
  139. \ NMAS_AUTHEN
  140. \ KERBEROS_V5
  141. syn match ldapconfSASLMechanism contained display
  142. \ 'CRAM-MD5\|GSS-SPNEGO\|DIGEST-MD5\|9798-[UM]-\%(RSA-SHA1-ENC\|\%(EC\)\=DSA-SHA1\)\|NMAS-SAMBA-AUTH'
  143. " TODO: I have been unable to find a definition for a SASL realm,
  144. " authentication identity, and proxy authorization identity.
  145. syn match ldapconfSASLRealm contained display
  146. \ '\S\+'
  147. syn match ldapconfSASLAuthID contained display
  148. \ '\S\+'
  149. syn keyword ldapconfSASLSecProps contained
  150. \ none
  151. \ noplain
  152. \ noactive
  153. \ nodict
  154. \ noanonymous
  155. \ forwardsec
  156. \ passcred
  157. \ nextgroup=ldapconfSASLSecPSep
  158. syn keyword ldapconfSASLSecProps contained
  159. \ minssf
  160. \ maxssf
  161. \ maxbufsize
  162. \ nextgroup=ldapconfSASLSecPEq
  163. syn match ldapconfSASLSecPEq contained display
  164. \ '='
  165. \ nextgroup=ldapconfSASLSecFactor
  166. syn match ldapconfSASLSecFactor contained display
  167. \ '\d\+'
  168. \ nextgroup=ldapconfSASLSecPSep
  169. syn match ldapconfSASLSecPSep contained display
  170. \ ','
  171. \ nextgroup=ldapconfSASLSecProps
  172. syn match ldapconfFilename contained display
  173. \ '.\+'
  174. syn match ldapconfPath contained display
  175. \ '.\+'
  176. " Defined in openssl-ciphers(1).
  177. " TODO: Should we include the stuff under CIPHER SUITE NAMES?
  178. syn cluster ldapconfTLSCipher contains=ldapconfTLSCipherOp,
  179. \ ldapconfTLSCipherName,
  180. \ ldapconfTLSCipherSort
  181. syn match ldapconfTLSCipherOp contained display
  182. \ '[+!-]'
  183. \ nextgroup=ldapconfTLSCipherName
  184. syn keyword ldapconfTLSCipherName contained
  185. \ DEFAULT
  186. \ COMPLEMENTOFDEFAULT
  187. \ ALL
  188. \ COMPLEMENTOFALL
  189. \ HIGH
  190. \ MEDIUM
  191. \ LOW
  192. \ EXP
  193. \ EXPORT
  194. \ EXPORT40
  195. \ EXPORT56
  196. \ eNULL
  197. \ NULL
  198. \ aNULL
  199. \ kRSA
  200. \ RSA
  201. \ kEDH
  202. \ kDHr
  203. \ kDHd
  204. \ aRSA
  205. \ aDSS
  206. \ DSS
  207. \ aDH
  208. \ kFZA
  209. \ aFZA
  210. \ eFZA
  211. \ FZA
  212. \ TLSv1
  213. \ SSLv3
  214. \ SSLv2
  215. \ DH
  216. \ ADH
  217. \ AES
  218. \ 3DES
  219. \ DES
  220. \ RC4
  221. \ RC2
  222. \ IDEA
  223. \ MD5
  224. \ SHA1
  225. \ SHA
  226. \ Camellia
  227. \ nextgroup=ldapconfTLSCipherSep
  228. syn match ldapconfTLSCipherSort contained display
  229. \ '@STRENGTH'
  230. \ nextgroup=ldapconfTLSCipherSep
  231. syn match ldapconfTLSCipherSep contained display
  232. \ '[:, ]'
  233. \ nextgroup=@ldapconfTLSCipher
  234. syn keyword ldapconfTLSCertCheck contained
  235. \ never
  236. \ allow
  237. \ try
  238. \ demand
  239. \ hard
  240. syn keyword ldapconfTLSCRLCheck contained
  241. \ none
  242. \ peer
  243. \ all
  244. hi def link ldapconfTodo Todo
  245. hi def link ldapconfComment Comment
  246. hi def link ldapconfOption Keyword
  247. hi def link ldapconfDeprOption Error
  248. hi def link ldapconfString String
  249. hi def link ldapconfURI ldapconfString
  250. hi def link ldapconfDNAttrType Identifier
  251. hi def link ldapconfOperator Operator
  252. hi def link ldapconfEq ldapconfOperator
  253. hi def link ldapconfDNAttrTypeEq ldapconfEq
  254. hi def link ldapconfValue ldapconfString
  255. hi def link ldapconfDNAttrValue ldapconfValue
  256. hi def link ldapconfSeparator ldapconfOperator
  257. hi def link ldapconfDNSeparator ldapconfSeparator
  258. hi def link ldapconfHost ldapconfURI
  259. hi def link ldapconfNumber Number
  260. hi def link ldapconfPort ldapconfNumber
  261. hi def link ldapconfBoolean Boolean
  262. hi def link ldapconfInteger ldapconfNumber
  263. hi def link ldapconfType Type
  264. hi def link ldapconfDerefWhen ldapconfType
  265. hi def link ldapconfDefine Define
  266. hi def link ldapconfSASLMechanism ldapconfDefine
  267. hi def link ldapconfSASLRealm ldapconfURI
  268. hi def link ldapconfSASLAuthID ldapconfValue
  269. hi def link ldapconfSASLSecProps ldapconfType
  270. hi def link ldapconfSASLSecPEq ldapconfEq
  271. hi def link ldapconfSASLSecFactor ldapconfNumber
  272. hi def link ldapconfSASLSecPSep ldapconfSeparator
  273. hi def link ldapconfFilename ldapconfString
  274. hi def link ldapconfPath ldapconfFilename
  275. hi def link ldapconfTLSCipherOp ldapconfOperator
  276. hi def link ldapconfTLSCipherName ldapconfDefine
  277. hi def link ldapconfSpecial Special
  278. hi def link ldapconfTLSCipherSort ldapconfSpecial
  279. hi def link ldapconfTLSCipherSep ldapconfSeparator
  280. hi def link ldapconfTLSCertCheck ldapconfType
  281. hi def link ldapconfTLSCRLCheck ldapconfType
  282. let b:current_syntax = "ldapconf"
  283. let &cpo = s:cpo_save
  284. unlet s:cpo_save