denyhosts.vim 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. " Vim syntax file
  2. " Language: denyhosts configuration file
  3. " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
  4. " Latest Revision: 2007-06-25
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. let s:cpo_save = &cpo
  9. set cpo&vim
  10. syn keyword denyhostsTodo
  11. \ contained
  12. \ TODO
  13. \ FIXME
  14. \ XXX
  15. \ NOTE
  16. syn case ignore
  17. syn match denyhostsComment
  18. \ contained
  19. \ display
  20. \ '#.*'
  21. \ contains=denyhostsTodo,
  22. \ @Spell
  23. syn match denyhostsBegin
  24. \ display
  25. \ '^'
  26. \ nextgroup=@denyhostsSetting,
  27. \ denyhostsComment
  28. \ skipwhite
  29. syn cluster denyhostsSetting
  30. \ contains=denyhostsStringSetting,
  31. \ denyhostsBooleanSetting,
  32. \ denyhostsPathSetting,
  33. \ denyhostsNumericSetting,
  34. \ denyhostsTimespecSetting,
  35. \ denyhostsFormatSetting,
  36. \ denyhostsRegexSetting
  37. syn keyword denyhostsStringSetting
  38. \ contained
  39. \ ADMIN_EMAIL
  40. \ SMTP_HOST
  41. \ SMTP_USERNAME
  42. \ SMTP_PASSWORD
  43. \ SMTP_FROM
  44. \ SMTP_SUBJECT
  45. \ BLOCK_SERVICE
  46. \ nextgroup=denyhostsStringDelimiter
  47. \ skipwhite
  48. syn keyword denyhostsBooleanSetting
  49. \ contained
  50. \ SUSPICIOUS_LOGIN_REPORT_ALLOWED_HOSTS
  51. \ HOSTNAME_LOOKUP
  52. \ SYSLOG_REPORT
  53. \ RESET_ON_SUCCESS
  54. \ SYNC_UPLOAD
  55. \ SYNC_DOWNLOAD
  56. \ ALLOWED_HOSTS_HOSTNAME_LOOKUP
  57. \ nextgroup=denyhostsBooleanDelimiter
  58. \ skipwhite
  59. syn keyword denyhostsPathSetting
  60. \ contained
  61. \ DAEMON_LOG
  62. \ PLUGIN_DENY
  63. \ PLUGIN_PURGE
  64. \ SECURE_LOG
  65. \ LOCK_FILE
  66. \ HOSTS_DENY
  67. \ WORK_DIR
  68. \ nextgroup=denyhostsPathDelimiter
  69. \ skipwhite
  70. syn keyword denyhostsNumericSetting
  71. \ contained
  72. \ SYNC_DOWNLOAD_THRESHOLD
  73. \ SMTP_PORT
  74. \ PURGE_THRESHOLD
  75. \ DENY_THRESHOLD_INVALID
  76. \ DENY_THRESHOLD_VALID
  77. \ DENY_THRESHOLD_ROOT
  78. \ DENY_THRESHOLD_RESTRICTED
  79. \ nextgroup=denyhostsNumericDelimiter
  80. \ skipwhite
  81. syn keyword denyhostsTimespecSetting
  82. \ contained
  83. \ DAEMON_SLEEP
  84. \ DAEMON_PURGE
  85. \ AGE_RESET_INVALID
  86. \ AGE_RESET_VALID
  87. \ AGE_RESET_ROOT
  88. \ AGE_RESET_RESTRICTED
  89. \ SYNC_INTERVAL
  90. \ SYNC_DOWNLOAD_RESILIENCY
  91. \ PURGE_DENY
  92. \ nextgroup=denyhostsTimespecDelimiter
  93. \ skipwhite
  94. syn keyword denyhostsFormatSetting
  95. \ contained
  96. \ DAEMON_LOG_TIME_FORMAT
  97. \ DAEMON_LOG_MESSAGE_FORMAT
  98. \ SMTP_DATE_FORMAT
  99. \ nextgroup=denyhostsFormatDelimiter
  100. \ skipwhite
  101. syn keyword denyhostsRegexSetting
  102. \ contained
  103. \ SSHD_FORMAT_REGEX
  104. \ FAILED_ENTRY_REGEX
  105. \ FAILED_ENTRY_REGEX2
  106. \ FAILED_ENTRY_REGEX3
  107. \ FAILED_ENTRY_REGEX4
  108. \ FAILED_ENTRY_REGEX5
  109. \ FAILED_ENTRY_REGEX6
  110. \ FAILED_ENTRY_REGEX7
  111. \ USERDEF_FAILED_ENTRY_REGEX
  112. \ SUCCESSFUL_ENTRY_REGEX
  113. \ nextgroup=denyhostsRegexDelimiter
  114. \ skipwhite
  115. syn keyword denyhostURLSetting
  116. \ contained
  117. \ SYNC_SERVER
  118. \ nextgroup=denyhostsURLDelimiter
  119. \ skipwhite
  120. syn match denyhostsStringDelimiter
  121. \ contained
  122. \ display
  123. \ '[:=]'
  124. \ nextgroup=denyhostsString
  125. \ skipwhite
  126. syn match denyhostsBooleanDelimiter
  127. \ contained
  128. \ display
  129. \ '[:=]'
  130. \ nextgroup=@denyhostsBoolean
  131. \ skipwhite
  132. syn match denyhostsPathDelimiter
  133. \ contained
  134. \ display
  135. \ '[:=]'
  136. \ nextgroup=denyhostsPath
  137. \ skipwhite
  138. syn match denyhostsNumericDelimiter
  139. \ contained
  140. \ display
  141. \ '[:=]'
  142. \ nextgroup=denyhostsNumber
  143. \ skipwhite
  144. syn match denyhostsTimespecDelimiter
  145. \ contained
  146. \ display
  147. \ '[:=]'
  148. \ nextgroup=denyhostsTimespec
  149. \ skipwhite
  150. syn match denyhostsFormatDelimiter
  151. \ contained
  152. \ display
  153. \ '[:=]'
  154. \ nextgroup=denyhostsFormat
  155. \ skipwhite
  156. syn match denyhostsRegexDelimiter
  157. \ contained
  158. \ display
  159. \ '[:=]'
  160. \ nextgroup=denyhostsRegex
  161. \ skipwhite
  162. syn match denyhostsURLDelimiter
  163. \ contained
  164. \ display
  165. \ '[:=]'
  166. \ nextgroup=denyhostsURL
  167. \ skipwhite
  168. syn match denyhostsString
  169. \ contained
  170. \ display
  171. \ '.\+'
  172. syn cluster denyhostsBoolean
  173. \ contains=denyhostsBooleanTrue,
  174. \ denyhostsBooleanFalse
  175. syn match denyhostsBooleanFalse
  176. \ contained
  177. \ display
  178. \ '.\+'
  179. syn match denyhostsBooleanTrue
  180. \ contained
  181. \ display
  182. \ '\s*\%(1\|t\%(rue\)\=\|y\%(es\)\=\)\>\s*$'
  183. syn match denyhostsPath
  184. \ contained
  185. \ display
  186. \ '.\+'
  187. syn match denyhostsNumber
  188. \ contained
  189. \ display
  190. \ '\d\+\>'
  191. syn match denyhostsTimespec
  192. \ contained
  193. \ display
  194. \ '\d\+[mhdwy]\>'
  195. syn match denyhostsFormat
  196. \ contained
  197. \ display
  198. \ '.\+'
  199. \ contains=denyhostsFormattingExpandos
  200. syn match denyhostsFormattingExpandos
  201. \ contained
  202. \ display
  203. \ '%.'
  204. syn match denyhostsRegex
  205. \ contained
  206. \ display
  207. \ '.\+'
  208. " TODO: Perhaps come up with a better regex here? There should really be a
  209. " library for these kinds of generic regexes, that is, URLs, mail addresses, …
  210. syn match denyhostsURL
  211. \ contained
  212. \ display
  213. \ '.\+'
  214. hi def link denyhostsTodo Todo
  215. hi def link denyhostsComment Comment
  216. hi def link denyhostsSetting Keyword
  217. hi def link denyhostsStringSetting denyhostsSetting
  218. hi def link denyhostsBooleanSetting denyhostsSetting
  219. hi def link denyhostsPathSetting denyhostsSetting
  220. hi def link denyhostsNumericSetting denyhostsSetting
  221. hi def link denyhostsTimespecSetting denyhostsSetting
  222. hi def link denyhostsFormatSetting denyhostsSetting
  223. hi def link denyhostsRegexSetting denyhostsSetting
  224. hi def link denyhostURLSetting denyhostsSetting
  225. hi def link denyhostsDelimiter Normal
  226. hi def link denyhostsStringDelimiter denyhostsDelimiter
  227. hi def link denyhostsBooleanDelimiter denyhostsDelimiter
  228. hi def link denyhostsPathDelimiter denyhostsDelimiter
  229. hi def link denyhostsNumericDelimiter denyhostsDelimiter
  230. hi def link denyhostsTimespecDelimiter denyhostsDelimiter
  231. hi def link denyhostsFormatDelimiter denyhostsDelimiter
  232. hi def link denyhostsRegexDelimiter denyhostsDelimiter
  233. hi def link denyhostsURLDelimiter denyhostsDelimiter
  234. hi def link denyhostsString String
  235. if exists('g:syntax_booleans_simple') || exists('b:syntax_booleans_simple')
  236. hi def link denyhostsBoolean Boolean
  237. hi def link denyhostsBooleanFalse denyhostsBoolean
  238. hi def link denyhostsBooleanTrue denyhostsBoolean
  239. else
  240. hi def denyhostsBooleanTrue term=bold ctermfg=Green guifg=Green
  241. hi def denyhostsBooleanFalse ctermfg=Red guifg=Red
  242. endif
  243. hi def link denyhostsPath String
  244. hi def link denyhostsNumber Number
  245. hi def link denyhostsTimespec Number
  246. hi def link denyhostsFormat String
  247. hi def link denyhostsFormattingExpandos Special
  248. hi def link denyhostsRegex String
  249. hi def link denyhostsURL String
  250. let b:current_syntax = "denyhosts"
  251. let &cpo = s:cpo_save
  252. unlet s:cpo_save